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

java.util.NoSuchElementException Error?
Java 8 Method references called on a local variable
Whenever I run the android login application it just crashes an a series of error messages in log
measure short distance android GPS
What does android:progressTintMode, android:secondaryProgressTintMode and android:progressDrawable do?
Exception in thread “main” java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
Enter multiple numbers in console
Getting file name of file being recieved on the server
Unsure about the best loop to use
Improve performance of reversing array
My Jsoup code extract elements within the first <td> tag of table only
In Java Windows Application using PdfBox Proguard zaps me
Consuming Spring Hateoas Restservice with RestTemplate
MASON Get Moore Neighbors
Java “no such element exception”
Trying to refer to a final ImageView does not work

Categories

HOME
sendgrid
proxy
reflection
plot
platform-builder
syntax
android-4.4-kitkat
sql-server-2016
ezpublish
cross-validation
slick-slider
alignment
visual-studio-cordova
reverse-proxy
riot.js
google-search-api
chromium-embedded
android-widget
angular2-aot
javacv
replaceall
windows-server-2000
primitive
srcset
preg-match
directx-10
bcd
binary-data
ioio
dosbox
libvpx
android-browser
jna
hue
splice
trim
sql-server-agent
node-gyp
sencha-touch-2.3
qcombobox
wptoolkit
apple-news
logfiles
jsch
rainbowtable
carrot
sqlbulkcopy
flutterwave
lync-client-sdk
crosswalk-runtime
visual-c++-2008
removechild
multi-level
nsfilemanager
flash-cs5
pagedlist
actionbardrawertoggle
superstack
comobject
purge
iis-arr
computer-algebra-systems
tableau-online
splash
apache-commons-fileupload
c3
tt-news
applescript-objc
gulp-less
internet-connection
android-radiobutton
wp-query
htmlcleaner
doskey
openlaszlo
imdbpy
farseer
type-equivalence
smtp-auth
robotics-studio
selected
netbeans-6.9
assembly-loading
appendto
floating
cxxtest
fluent-interface
sudzc
modelstate
procedural-music
ajax-forms

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