Problems with Keyboard
Hi I'm trying to compile a simple program as a test run but I can't seem to be able to do it properly. It was working a few months ago but something seems to be wrong now:
This is a simple test program:
import java.awt.*;
import java.applet.Applet;
public class Maths101extends Applet{
public void init() {
// Calculates the square or cube of a number depending on the user's choice
int number, choice, result;
System.out.println("Please enter a number: ");
number = Keyboard.readInt();
System.out.print("Please enter your choice (1 or 2): ");
choice = Keyboard.readInt();
if (choice == 1)
System.out.println("The number is: " + number);
else if (choice == 2)
System.out.println("The square of the number is: " + number * number);
else
System.out.println("Incorrect choice");
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
}
}
I get these errors:
C:\Documents and Settings\ral_ani\Desktop\\Maths101.java:14: cannot find symbol
symbol : variable Keyboard
location: class Maths101
number = Keyboard.readInt();
^
C:\Documents and Settings\ral_ani\Desktop\\Maths101.java:17: cannot find symbol
symbol : variable Keyboard
location: class Maths101
choice = Keyboard.readInt();
^
2 errors
Tool completed with exit code 1
What am I doing wrong?

