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

GZIPInputStream unable to decode at receiver side (invalid code lengths set)
Is there any benefit to upgrading Java 7 compiled code to Java 8?
Output total for 2d array
Exception when trying to instrument source code by WALA: java.lang.ClassFormatError: StackMapTable format error: wrong attribute size
SQLException [42000-175], Error at INIT RUNSCRIPT H2 database Embedded
NullPointer exception when using ImageView.SetImage() [duplicate]
Date and 'polymorphic' class causes JsonGenerationException: BsonSerializer can only be used with BsonGenerator
android out of memory imagebutton
Android draw ball trail
Cannot add/ subtract/ multiply/ divide two numbers from two textfields [duplicate]
How to solve maven COMPILATION ERROR: package X does not exist? [duplicate]
Unexplained zero added when going from java.util.Date to java.sql.Timestamp
Icon not displaying in notification: white square shown instead and display it using mipmap launcher
How to set the Image and the Text at the center of Button in android
Java. How do I make code more effectly, HashMap?
Inserting SUM of one column from one table to another column of another table in JAVA

Categories

HOME
java
server
deezer
comparison
alpha
cross-browser
correlation
gz
static-libraries
hex-editors
seaborn
saxon
jsdoc
reactive-cocoa
jtextfield
xlsxwriter
tapestry
dynamic-featured-image
wpfdatagrid
intel-pin
user-interaction
maxmind
kendo-datasource
newline
tinymce-4
react-chartjs
ioio
catel
gtrendsr
xmlreader
language-concepts
picasso
vxworks
restlet
x11-forwarding
hockeyapp
code-search-engine
theano.scan
ssjs
janrain
arena-simulation
import-from-excel
segment
convertapi
galleria
user-accounts
xml-documentation
pubmed
recursive-datastructures
colorama
slickedit
dtexec
hittest
vtigercrm
removechild
azure-virtual-network
ready-api
ios4
xna-4.0
prerequisites
simple-framework
emailrelay
ibaction
microbenchmark
appfabric-cache
mono-embedding
sortedlist
inmobi
phalanger
qcodo
rdtsc
applescript-objc
socketexception
code-access-security
eol
funcunit
bundles
mysqltuner
bulkloader
eventual-consistency
referrer
sublist
coderush
wse3.0
postgresql-performance
php-parser
servicehost
telerik-scheduler
dentrix
.net-1.0
uiq3

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