Hello I am trying to create a multiplication program where the user enters a number then is multiplied by 1 - 12
heres what I have so far
Quote:
//Import the input/output library.
import java.io.*;
class InputPractice1
{
public static void main (String args [])
//Prevents the program from crashing if incorrect input is entered.
throws java.io.IOException
{
// Allows input from the keyboard.
BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
String name = "number";
System.out.println ("Please enter a number:");
//Waits for user input.
name = br.readLine();
System.out.println (number + "x 1 = " + number * 1); <-----THIS LINE KEEPS GIVING ME PROBLEMS
}
}
I keep getting an error that says
2 errors found:
File: H:\ICS\nEW\InputPractice1.java [line: 33]
Error: cannot find symbol
symbol : variable number
location: class InputPractice1
File: H:\ICS\nEW\InputPractice1.java [line: 33]
Error: cannot find symbol
symbol : variable number
location: class InputPractice1
been trying but I cant get it to work. Please take a look any help is appreciated