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 to read each line of integers seperatly
How can I check if two strings are permutations of each other in O(n) time? (java)
How to create custom assertions for collections in AssertJ
performance issue while reading many files
Spring Security: How to reject a request by default if no #PreAuthorize was specified
How to add external CSS to HTML 'style'
No suitable driver found for jdbc:mysql, on server with Maven (Java)
Annotating tree nodes with data for analysis with the Java Evolutionary Biology Library (JEBL)
Parsing Exception when Connecting to File Location Using Alfresco
How to know whether a class has been initialized or not?
How to Generate the Collatz tree in Java?
String substring methods [duplicate]
Needs help for Genetic Algorithm Single-Point Crossover Mechanism in Java
Best tool to use to “convert” Android apk into runnable web app(let)? [closed]
How to populate a collection in java?
Extract Java comment body (without //, /*, */)

Categories

HOME
testing
netsuite
deezer
ngrx
onedrive
lodash
electron
gis
jira
ebean
azure-storage-tables
append
wheelnav.js
u-sql
size
iron-router
lombok
seaborn
google-static-maps
aurigma
viewport
alpine
excel-2007
p-value
intel-pin
phpfox
entitlements
publish
ping
facebook-apps
objectanimator
tasklet
media-queries
cloud-code
mmenu
mapdb
vxworks
dosbox
objectlistview
temporary-files
azure-ml
core-plot
turbogears
outlook-api
qwt
scrollable
appcompat
pango
boost-multi-index
blogengine.net
setter
nativeapplication
magma
mcafee
iso8601
vtigercrm
firmata
radtreelist
savon
dstu2-fhir
file-writing
holder.js
simplewebrtc
hill-climbing
ipconfig
ios8-today-widget
collapse
wordml
jqgrid-formatter
apache-commons-fileupload
processmodel
dereference
lustre
system.reflection
jsonpickle
dd
codeigniter-routing
preferences
issuu
html-helper
has-many-through
fluentautomation
gnu-smalltalk
gridfs
inbox
web2py-modules
easy-install
batterylevel
semantic-diff
bigcouch
custom-backend
whoosh
window-management
blackberry-playbook
tomcat-valve
recent-documents
pyinotify
yslow
zend-translate
web-architecture
xetex
temporal-database
data-acquisition

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