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

click handler on material icon doesn't works in a class but it is working in another class where the procedure is same
IMAP All Mail folder message count is incorrect
Designing single API for two different types
Camera works without giving camera permission
Java Android finish activity , start previous activity
How to convert IBM DB2 hexadecimal data in proper format (CCSID 37) at connection level without using CAST function
A simple java program output is not as expected with IO
How to prevent background scrolling when displaying popup in selenium webdriver?
java.lang.NoSuchMethodError: org.apache.spark.streaming.api.java.JavaDStream.foreachRDD(Lorg/apache/spark/api/java/function/Function;)V [duplicate]
How to change, inside a class, the value of an attribute in runtime?
Function to update input xml by passing instance of object using JAXB
Performance difference between Java direct array index access vs. for loop access
java - Input 2 integer arrays and print alternating elements
Getting null pointer exception. Not able to print the Array list data in Testing method [duplicate]
UCAExc 3.0.7 unexpected token Errors
java singleton class vs final class

Categories

HOME
compiler-construction
twitter
testing
nullpointerexception
smarty
layout
rsyslog
framework7
icloud
python-unittest
node-pdfkit
google-cloud-spanner
iolanguage
normalizr
sms-gateway
nodatime
predix
csrf-protection
zurb-foundation-6
jndi
opennlp
wpfdatagrid
maquette
jspm
jaxb2
libssl
srcset
bluestacks
google-rich-snippets
frame
siesta-swift
code-contracts
atl
jquery-bootgrid
espeak
mixture-model
occlusion
http-live-streaming
netcdf4
slick-3.0
qwt
azure-application-gateway
filepicker
jquery-validate
pnotify
datastax-startup
idisposable
lift-json
quartz-composer
xcb
log4c
measures
firebaseui
ubuntu-10.04
dlna
livequery
revolution-r
sdhc
icu4j
jmeter-maven-plugin
spidermonkey
angular-leaflet-directive
apache-commons-fileupload
graph-api-explorer
knuth
network-interface
angularjs-ng-click
cctv
socketexception
client-side-templating
code-access-security
zend-route
valueconverter
system.net.webexception
flexmojos
dir
jmapviewer
dotnetnuke-5
easy-install
excel-2003
rabl
libstdc++
twrequest
wse3.0
assembly-loading
data-loss
locate
imac
html-input
windows-live-messenger
3gp

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