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
Exception in thread main - How do I fix this [duplicate]
OpenJDK throws “certificate chaining errors”
How would I create a responsive layout in Java Swing
One use Java audio?
Java error: constructor cannot be applied to given types?
Java: When to use String[] args over String args[] [duplicate]
Android ad request. Keywords from string array
Oracle Weblogic 12.1.2 Node Manager Status java.io.IOException
Parsing string based on different delimiters
OutOfBoundsException When Calling Return For A Method JAVA
Converting Hexadecimal String to Decimal Integer
Security Framework for Java Swing Applications
Does Java 7 Hotspot JVM use SIGRT* on Linux?
Why do I have to call an XML element in function and not in onCreate?
JSF Configuration issue in Eclipse Galelio
java thread not going out of scope