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

user account control issue when running external exe in java
Java for each statement
How can i be able to reorder this arraylist?
Parsing custom BBCode with KefirBB
Why is File.pathSeparatorChar a semicolon on Windows?
handlePartialResponseError SEVERE: javax.el.MethodNotFoundException: Method not found: allser.com.company.jsfimpl.AxeBean#25f8da.onAxeChosen()
why do we use servletconfig interface and servletcontext interface [closed]
Connect to a remote mysql server [closed]
Finding how many number sequences are in the string and handling each
Crash's trying to find view
com.jcraft.jsch.JSchException: Algorithm negotiation fail at com.jcraft.jsch.Session.receive_kexinit(Unknown Source)
Take pictures and saving to SD card
Retrieve first document from collection using findOne() MongoDB
Invalid escape sequence in Java expression
java multi threading - how to synchronise
HashMap in JSF not showing the value if the key is a non standard Object

Categories

HOME
xamarin
wso2-am
osgi
push-notification
kde
nullpointerexception
view
gis
yarn
paw-app
jpeg
flyway4
multiple-records
python-unittest
modx-revolution
nstableview
n-gram
designer
samoa
swiftlint
paging
graphicsmagick
sox
java-7
srcset
socialengine
key-value-observing
google-cloud-endpoints-v2
twilio-api
revolution-slider
io-redirection
file-format
web-mining
sharefile
webix-treetable
impersonation
hue
ruby-on-rails-3.1
appcompat
python-c-api
elgg
libusb-win32
flow-control
root-framework
ableton-live
static-ip-address
deadbolt-2
dstu2-fhir
flash-cs5
persist
simplewebrtc
ubuntu-10.04
ipconfig
oauth2client
ptrace
jfugue
prerequisites
lemon
collapse
ruby-2.2
jqgrid-formatter
ibaction
createprocessasuser
unity3d-gui
pretty-print
sorl-thumbnail
relocation
issuu
internet-connection
zend-route
message-driven-bean
page-layout
c18
quantlib-swig
opcache
yui-compressor
angularjs-controller
sublist
trusted
propertyeditor
viewswitcher
dbproviderfactories
qtkit
windows-phone-7.1.1
nsmanagedobject
horizontal-accordion
blitz++
xsdobjectgen
vc90
iweb
mediarss
signal-handling
paul-graham

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile