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

Exception in thread main - How do I fix this [duplicate]
OpenJDK throws “certificate chaining errors”
How would I create a responsive layout in Java Swing
One use Java audio?
Java error: constructor cannot be applied to given types?
Java: When to use String[] args over String args[] [duplicate]
Android ad request. Keywords from string array
Oracle Weblogic 12.1.2 Node Manager Status java.io.IOException
Parsing string based on different delimiters
OutOfBoundsException When Calling Return For A Method JAVA
Converting Hexadecimal String to Decimal Integer
Security Framework for Java Swing Applications
Does Java 7 Hotspot JVM use SIGRT* on Linux?
Why do I have to call an XML element in function and not in onCreate?
JSF Configuration issue in Eclipse Galelio
java thread not going out of scope

Categories

HOME
testing
log4j
google-chrome-extension
clips
kde
iot
bpmn
xmpp
infragistics
sql-server-2016
cross-browser
blueprintjs
fancybox
mouse
azure-storage-tables
esper
rascal
task
decomposition
worldwind
systemc
libtiff
graphlab
django-cms
one-hot-encoding
chromium-embedded
pass-by-reference
crystal-reports-2010
tdd
replaceall
primitive
file-rename
phonegap
oracle-fusion-middleware
hybridauth
phpfreechat
windows-dev-center
force-layout
libraries
withings
leading-zero
cookiecutter-django
ws-security
elmah
texmaker
jvm-languages
ibpy
unixodbc
atomicity
logparser
winscp-net
pebble-watch
rdfs
diagnostics
sqlclient
magma
boost-preprocessor
knpmenubundle
color-profile
titanium-android
eventkit
visual-c++-2008
ableton-live
google-feed-api
slicknav
azure-virtual-network
dstu2-fhir
thrust
markojs
ready-api
msys
lemon
collapse
citrus-pay
cakephp-3.1
web-controls
unity5.2.3
device-orientation
c++03
asp.net-dynamic-data
rdl
flask-cors
mesa
rebol3
valuechangelistener
meteor-velocity
fmod
prettify
flexmojos
ms-project-server-2010
dotnetnuke-5
chuck
coderush
hosts-file
getmessage
parametric-equations
bigcouch
boost-filesystem
data-loss
heartbeat
invite
datareader
lang
cxxtest
infrastructure
mozilla-prism
filtered-index
fixed-width
multi-tier
substrings
eqatec
boost-smart-ptr
sustainable-pace
procedural-music
w3wp
uiq3

Resources

Encrypt Message