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

Spring doesn't detect my #pathvariable
Does Android Application Upgrade call the Class that extends Application?
How to compute wordcount by group key in Spark?
Serialize a map of lambda functions
How to get the number of updated records in SQL component in Switchyard
Java Spring Customized Annotation Variable Instantiation Issue
Hibernate criteria accessing joined fields
Connecting to MS-SQL server using Java in Selenuim Automation Test
Open a File in default File explorer and highlight it using JavaFX or plain Java
IllegalArgumentException when writing bytes to file
content layout navigation and linkable urls
Java execution randomly stopping
Setting ImageView at certain positions in a ListView based on CheckBox
How can I make this faster, without making it multi-threaded?
How to Have my JLabels Display Strings stored in my ArrayList?
how to display this notification in Android?

Categories

HOME
minimum-spanning-tree
ngrx
setup-deployment
tizen-web-app
rubygems
gps
mouse
contact
primary-key
wheelnav.js
google-cloud-spanner
angular-ui
propel
django-cms
object-detection
intentfilter
cultureinfo
wijmo
chromebook
maquette
libssl
quote
newline
nameservers
google-sites-2016
perlin-noise
webtest
picasso
wixsharp
lto
cookiecutter-django
g-code
nxlog
pubmed
carrot
diagnostics
pillow
gcsfuse
angular-strap
xcb
medium.com
wdf
infix-notation
log4c
py2app
etsy
bstr
websitepanel
simplewebrtc
react-native-listview
moveit
whois
oauth2client
separator
endeca-workbench
retina
tarjans-algorithm
map-projections
inmobi
jsapi
oxwall
nsbutton
ceil
fmod
floating-point-precision
page-layout
c18
tws
pushbackinputstream
android-screen-support
lcs
ocunit
angularjs-controller
propertyeditor
newtonscript
dbproviderfactories
nsdatecomponents
servicehost
propagation
lang
html-input
.nettiers
ext3
caching-application-block

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile