hi i am new for java. i copy this code from a book and got error message.
pls help.

// Compute Mortgage.java: compute mortgage payments
import javax.swing.JOptionPane;
public class ComputeMortgage {
/**main method*/
public static void main(String[] args) {
double annualInterestRate;
int numOfYears;
double loanAmount;
// Enter yearly interest rate
String annualInterestRateString = JOptionpane.showInputDialog(
null,"Enter yearly interest rate, for example 8.25: ", "Example 2.3 Input",
JOptionpane.QUESTION_MESSAGE);
//Convert string to double
annualInterestRate= Double.parseDouble(annualInteresRateString);
//obtain monthly interest rate
double monthlyInterestRate= annualInterestRate/1200;
//Enter number of years
String numOfYearsString=JOptionpane.showInputDialog
(null, "Enter number of ears as an integer,\nfor example 5:",
"Example 2.3 Input", JOptionpane.QUESTION_MESSAGE);
//Convert string to int
numOfYears= Integer.parseInt(numOfYearsString);
//Enter loan amount
String loanString = JOptionpane.showInputDialog
(null,"Enter number of years as an integer,\nfor example 5:",
"Example 2.3 Input",JOptionpane.QUESTION_MESSAGE);
//Convert string to double
loanAmount= Double.parseDouble(loanString);
//Calculate payment
double monthlypayment=loanAmount*monthlyInterestRate/
(1-1/Math.pow(1+monthlyInterestRate,numOfYear*12));
double totalpayment=monthlypayment*numOfYears*12;
//Format to keep two digits after the decimal point
monthlypayment=(int)(monthlypayment*100)/100.0;
totalpayment=(int)(totalpayment*100)/100.0;
//Dispaly results
String output="The monthly payment is "+ monthlypayment +
"\nThe total payment is "+ totalpayment;
JOptionpane.showMessageDialog(null,output,
"Example 2.3 output", JOptionpane.INFORMATION_MESSAGE);
System.exit(0);
}
}
/*****************'
C:\programming_in_java\JavaApplication1\ComputeMortgage.java:12: cannot find symbol
symbol : variable JOptionpane
location: class ComputeMortgage
JOptionpane.QUESTION_MESSAGE);
^
C:\programming_in_java\JavaApplication1\ComputeMortgage.java:10: cannot find symbol
symbol : variable JOptionpane
location: class ComputeMortgage
String annualInterestRateString = JOptionpane.showInputDialog(
^
C:\programming_in_java\JavaApplication1\ComputeMortgage.java:14: cannot find symbol
symbol : variable annualInteresRateString
location: class ComputeMortgage
annualInterestRate= Double.parseDouble(annualInteresRateString);
^
C:\programming_in_java\JavaApplication1\ComputeMortgage.java:20: cannot find symbol
symbol : variable JOptionpane
location: class ComputeMortgage
"Example 2.3 Input", JOptionpane.QUESTION_MESSAGE);
^
C:\programming_in_java\JavaApplication1\ComputeMortgage.java:18: cannot find symbol
symbol : variable JOptionpane
location: class ComputeMortgage
String numOfYearsString=JOptionpane.showInputDialog
^
C:\programming_in_java\JavaApplication1\ComputeMortgage.java:26: cannot find symbol
symbol : variable JOptionpane
location: class ComputeMortgage
"Example 2.3 Input",JOptionpane.QUESTION_MESSAGE);
^
C:\programming_in_java\JavaApplication1\ComputeMortgage.java:24: cannot find symbol
symbol : variable JOptionpane
location: class ComputeMortgage
String loanString = JOptionpane.showInputDialog
^
C:\programming_in_java\JavaApplication1\ComputeMortgage.java:31: cannot find symbol
symbol : variable numOfYear
location: class ComputeMortgage
(1-1/Math.pow(1+monthlyInterestRate,numOfYear*12));
^
C:\programming_in_java\JavaApplication1\ComputeMortgage.java:40: cannot find symbol
symbol : variable JOptionpane
location: class ComputeMortgage
"Example 2.3 output", JOptionpane.INFORMATION_MESSAGE);
^
C:\programming_in_java\JavaApplication1\ComputeMortgage.java:39: cannot find symbol
symbol : variable JOptionpane
location: class ComputeMortgage
JOptionpane.showMessageDialog(null,output,
^
10 errors

Tool completed with exit code 1