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

java.sql.SQLException: The url cannot be null [Multi modules App]
Create a RealmQuery on background thread
Hibernate's setParameterList is not working for Native SQL query
Regex removing all punctuation but leave decimal points and hyphenated words
How to update changes in tomcat without restarting while site is live?
Java/Chess Odd Gui Bug
Android store file size in long variable
What's a good way to display text messages in JavaFX FXML?
Running this from command line in Java
Insert a string variable inside a Where Clause
close() is not working, everytime a new window gets open
Upload multiple image to Parse Server Android Java
How to execute with Jooq arbitrary number of selects joined with UNION
How to get time difference between two ZonedDateTimes and pretty print it like “4 hours, 1 minute, 40 seconds ago”?
Log4J : Cannot create file using environment variable
How to use classloader to load class file from server to client

Categories

HOME
pandas
winforms
pdf
google-play
smarty
objectgears
routes
infragistics
malloc
rdf
yum
append
nstableview
google-cloud-ml
zebra-printers
carthage
dosgi
clojurescript
foselasticabundle
graphlab
facebook-page
reactcsstransitiongroup
database-replication
interop
lldb
errorlevel
pass-by-reference
tibco-mdm
captiveportal
format-specifiers
sparse-matrix
selectedindexchanged
entitlements
filezilla
buck
quote
srcset
bcd
google-cloud-endpoints-v2
titanium-mobile
lxd
uiswipegesturerecognizer
android-kernel
environment-modules
wpf-controls
android-ble
serve
x11-forwarding
abstract-class
uft-api
cookiecutter-django
preconditions
grid.mvc
quadratic-programming
reactive-cocoa-5
avconv
qsslsocket
composite-key
media-player
spring-mongodb
merge-conflict-resolution
lttng
blackberry-10
sigabrt
skype4py
python-stackless
nessus
revolution-r
itextpdf
xpath-1.0
separator
icu4j
php-ci
fluid-dynamics
generic-programming
composite
graph-api-explorer
bigbluebutton
kineticjs
python-green
facebook-graph-api-v2.4
neolane
heisenbug
valueconverter
ms-project-server-2010
.aspxauth
jmapviewer
odata4j
chronoforms
kyotocabinet
free-variable
getmessage
ecl
lpeg
h.323
coda-slider
preference
dbal
nintendo-ds
swing-app-framework
thread-local-storage

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