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

Handle uninitialized parameters in Java?
java: is there a framework that allows dynamically loading and unloading of jars (but not osgi)?
BlazeDS support on Z-Linux
Java Selector NIO Reading problem
Write a binary downloaded file to disk in Java
Graph Visualization in a Eclipse RCP aplication
What is the best way to store an AES encryption key?
Google App Engine / JDO : store computed values
Java library to “spell out” numbers in localized fashion
Reading/writing binary structures: how to simplify this code?
Table not created by Hibernate
pass array to method Java
Spring MVC Annotations with Global Context context:component-scan?
Java: splitting a comma-separated string but ignoring commas in quotes
Is it possible to run OSGi components within Weblogic 10.3?
Disable plugin contributions in Eclipse RCP Application

Categories

HOME
deployment
coq
gerrit
mockito
layout
platform-builder
setup-deployment
gps
pivotal-cloud-foundry
wamp
volttron
phaser
dtrace
windows-server-2012
iron-router
workload-scheduler
progressive-web-apps
django-admin
highlight.js
google-pagespeed
visual-composer
nodatime
intentfilter
hammerspoon
emgucv
sparse-matrix
uninstall
neo4j-spatial
delicious-api
flink-streaming
nameservers
lxd
mmenu
xcode-extension
web-mining
streamsets
impersonation
hue
awt
broadcastreceiver
fedex
node-gyp
mime
long-polling
menuitem
revapi
alphabet
dotnetzip
brightcove
pdfclown
mcafee
jspdf-autotable
spring-cache
bind9
dynamics-sl
minimization
quartz-composer
topbeat
parallel-data-warehouse
jquery-filter
deadbolt-2
removechild
savon
trash
plottable.js
flash-cs5
ipconfig
oauth2client
xpath-1.0
pyke
phpcas
hsv
srand
xna-4.0
wso2cloud
sframe
map-projections
mono-embedding
facebook-graph-api-v2.4
xc16
coldbox
tt-news
phalanger
fpml
asp.net-web-api-odata
castle
mesa
sgen
dealloc
android-2.2-froyo
floating-point-precision
mysqltuner
oam
xsockets.net
tws
back-stack
mylyn
yui-compressor
sqlperformance
drools-planner
specification-pattern
bluepill
manchester-syntax
automount
javaspaces
labwindows
buildr
php-parser
qt-jambi
horizontal-accordion
ecl
xfbml
subviews
gamequery
gamma
jquery-ui-droppable
firefox-5
w3wp
windows-live-messenger
document-conversion

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App