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

Calling findViewById in fragment returns null
Guessing game with minimum guesses used not working in Java
Android substring
Classes and Concrete Classes
Java Exceptions Prevent Closing The Program (when clicking X button)
how to print arrayList as string in java [duplicate]
Unable to open a websocket to Jetty with JSR 356
Convert String to Data base HTTP.UTF8 in swift
how to get a string from memcach on appengine - java
WFLYEJB0029: Could not restore timer from … com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
Select multiple ids in firebase [duplicate]
Remove all characters from String1 which are present in String2 and vice versa
How to Compare to Object class?
JavaFX combobox, on item clicked
How to align children in a HBox Left, Center and Right
Android TTS: “new line” or “space” voice command

Categories

HOME
react-virtualized
raspberry-pi
yarn
jgroups
blueprintjs
fancybox
flyway4
google-translate
facebook-php-sdk
floating-action-button
u-sql
gz
windows-phone-7
try-catch
iolanguage
dosgi
libtiff
oracle-coherence
nhibernate-envers
autocad-plugin
paging
excel-2007
semantic-analysis
librato
bosh
http-status-code-503
twilio-api
column-family
language-concepts
suricata
adobe-premiere
starteam
unspecified
impersonation
unoconv
janrain
wptoolkit
rainbowtable
idisposable
kbuild
lift-json
crypt
pycaffe
parallel-data-warehouse
android-fonts
nxt
mathematica-frontend
gridview-sorting
fputcsv
markojs
nsviewcontroller
packagist
suffix-tree
design-by-contract
jms2
retina
content-length
emailrelay
ionic
ibaction
microbenchmark
iiviewdeckcontroller
qpainter
angularjs-ng-click
qcodo
gulp-less
article
rebol3
dealloc
farseer
back-stack
mylyn
pygit2
cassini-dev
angularjs-controller
dmoz
getmessage
adk
f#-powerpack
appender
gdlib
imac
floating
datareader
web-application-design
suppress
getresponsestream
jquery-ui-droppable
xsdobjectgen
nintendo-ds
premature-optimization
private-members
ntvdm.exe

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App