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

How do I update a variable inside a Runnable?
How can I work around with “Vector smash protection is enabled”?
Iterating through elements in jsoup and parsing href
start multiple processes with start timer in activiti
Unable to add Pages to PDF using PDFBox using separate method from main()
how to get access to health apps shared data in android?
Export a WAB from an eclipse product / launch configuration
Transform and filter a Java Map with streams
JavaFX Animation - How to animate move in Z direction
Java concatenate 4 strings then truncate
AspectJ with Web-services and Java 6. How to do?
Java Swing Switch Between JInternalFrame and JFrame extends
Minimax Alpha Beta Algorithm
Hitting Dynamic Endpoint in Websphere 7.0
does #Capturing work for lambdas?
Spring Boot #ExceptionHandler hide Exception Name

Categories

HOME
osgi
netbeans
urbancode
minimum-spanning-tree
cvs
elm
rdf
fsm
disassembler
podio
applepay
metatrader4
izpack
imacros
orchardcms
msp430
telephony
saxon
nhibernate-envers
samoa
google-pagespeed
nodatime
kryo
csrf-protection
kudan
autosys
pepper
centos6.5
facet
semantic-analysis
bootstrap-material-design
tooltipster
opentype
jspm
objectanimator
media-queries
yadcf
preg-match-all
ioio
jspresso
rotational-matrices
google-api-nodejs-client
objectlistview
twitch
vapor
sqlite2
leading-zero
bootstrapper
preconditions
ruby-on-rails-3.1
nxlog
sage-one
veracode
typed-lambda-calculus
google-perftools
capacity
webdriverjs
background-service
instant
adxstudio-portals
autorest
superstack
bluemix-app-scan
browser-link
ios8-today-widget
msys
lib.web.mvc
tarjans-algorithm
unity3d-gui
iiviewdeckcontroller
lustre
sorl-thumbnail
ng-animate
file-copying
preferences
uitouch
didselectrowatindexpath
message-driven-bean
typo3-neos
oam
commoncrypto
cdc
web2py-modules
mylyn
armcc
hosts-file
postgresql-performance
locationlistener
inotifycollectionchanged
sql-server-profiler
blitz++
xsdobjectgen
swing-app-framework
project-hosting
django-notification

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile