java


Java Error: Input cannot be resolved


I am new to Java. Please bear with me. I am trying a simple program. The number of dogs equal a certain amount of points. 4 or more dogs equal 60 points.
import java.util.Scanner;
public class Welcome {
public static void main(String[] args){
int dogs,points;
Scanner scan = new Scanner(System.in);
System.out.println("Enter the number of dogs: ");
int dogs = input.nextInt();
switch (dogs)
{
case 0:
System.out.println("You've earned 0 points!");
case 1:
System.out.println("You've earned 5 points!");
break;
case 2:
System.out.println("You've earned 15 points!");
break;
default: System.out.println("You've earned 60 points!");
}
}
}
Any help will be appreciated.
import java.util.Scanner;
public class Welcome {
public static void main(String[] args) {
int dogs;
Scanner scan = new Scanner(System.in);
System.out.println("Enter the number of dogs: ");
dogs = scan.nextInt();
switch (dogs) {
case 0:
System.out.println("You've earned 0 points!");
break;
case 1:
System.out.println("You've earned 5 points!");
break;
case 2:
System.out.println("You've earned 15 points!");
break;
case 3:
System.out.println("You've earned 30 points!");
break;
case 4:
System.out.println("You've earned 60 points!");
break;
default:
System.out.println("You've earned 60 points!");
}
}
}

Related Links

Could not autowire field: private org.springframework.security.core.userdetails.UserDetailsService
When to use Table per class hierarchy over Table per subclass?
Flashing JTextField and JButton
How to automatically create jFrames using templates?
Error “Cannot find symbol method charAt(int)”? im not really sure how to fix this, any help would be appreciated :)
How to make an inner class implementation of Runnable work with an Executor in java?
JAR manifest codebase mismatch
how to test whether a set contains any sum of two other numbers in the set
Repeat Image along x axis in libgdx game for Android
How to display arraylist in tabular form in the java console
CollatorProvider mechanism has no effect on Collator
Disadvantages of having child first class loader? [closed]
Replacing a roman script MS Doc with unicode text : replaceText taking too long time
Java: How do i get the int that i need??? by using something to split them?
Regex for Hex Digits
NullPointerException in if statement

Categories

HOME
winforms
omnet++
single-sign-on
smarty
relative-path
iot
syntax
vmware
tesseract
grep
sd-card
at-command
tizen-web-app
frameworks
v8
icloud
pivotal-cloud-foundry
in-app-purchase
adobe-analytics
volttron
spring-xd
modelica
postgres-xl
collectd
fortumo
zebra-printers
http-status-code-504
pythonanywhere
beyondcompare
introduction
grails3
object-detection
one-hot-encoding
jasonette
wijmo
lcd
sqlcipher
numerical-methods
javacv
virtualdub
strncpy
srcset
bluestacks
preg-match-all
avcapturesession
uiswipegesturerecognizer
geopositioning
mmenu
host
devextreme
git-merge
serve
sfdc
grid.mvc
elmah
netcdf4
flickr-api
dotcover
jquery-validate
worksheet
blogengine.net
veracode
lowpass-filter
csound
gcsfuse
topbeat
angular-strap
google-feed-api
nsfilemanager
master-slave
suffix-tree
pervasive-sql
execute
riak-cs
0xdbe
fluid-dynamics
census
jsapi
operator-precedence
knuth
google-style-guide
angularjs-ng-click
applescript-objc
code-access-security
zend-route
google-reader
datagridviewcolumn
ccss
buster.js
gwt-rpc
mylyn
seed
manchester-syntax
ocx
parametric-equations
semantic-diff
adk
zpt
vdsp
xdomainrequest
yetanotherforum
nhibernate.search

Resources

Encrypt Message