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 jdbctemplate get byte array
Type mismatch: cannot convert from “sth” to “sth”
Java/Grails - unmarshalling UTF-8 encoded cyrillic characters
String split function not returning desired output [duplicate]
Is it possible to return a copy of an element in a Generic Vector in Java instead of a reference to it?
Hibernate: Persist collection of elements by providing the ids only and return the complete instance
Joining both hashsets together
Only the first commandLink in dataTable is clickable
Eclipse: exclude a 'runtime' maven dependency from the build path
Dijkstra shortest path algorithm: finding number of checked vertices
How to create a method in other class drawing on JPanel
SIGSEGV error when trying to use AutoCompleteTextView
Multiple EJB files, “loader constraint violation” error with JBoss/Wildfly
Unsuccessful: alter table add constraint: Table doesn't exist on create
How to Decrypt file with out store into system memory using java?
Android media player works with some url but not with others

Categories

HOME
bluetooth
hp-exstream
iot
grep
elm
tizen-web-app
binary-tree
ezpublish
echarts
podio
slick-slider
session-variables
dacpac
floating-action-button
task
fallback
opentracing
visjs
microsoft-sync-framework
neo4j-spatial
opentype
kendo-datasource
.net-4.0
airconsole
pim
commit
vxworks
serve
libraries
withings
abstract-class
leading-zero
preconditions
arena-simulation
keydown
outlook-api
http-redirect
eclipse-gef
rainbowtable
git-diff
forever
sqlclient
r-forge
akka-cluster
color-picker
httplistener
rotativa
log4c
mathematica-frontend
bluemix-app-scan
spim
msys
google-places
cannon.js
purge
browser-bugs
system32
e10s
device-orientation
directoryservices
oxwall
dd
rdtsc
code-access-security
rdl
article
dml
system.net.webexception
kgdb
multiprocessor
dotnetnuke-5
orchardcms-1.7
specification-pattern
libstdc++
frameset
word-processor
buildr
pendrive
table-footer
cxxtest
fluent-interface
digest-authentication
sortable-tables
infrastructure
rescale
audio-capture
virtual-functions

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