Hello:
I am a student and am attempting to write a multidimensional array for a Mortgage Calculator program. We have to display three different mortgage's that display 3 different interest rates and term years that show the calculated mortgage payment amount. I have the following code and am receiving many errors and I can't progress unless I can figure out what I am doing wrong, so if anyone can give me some guidance I would appreciate it. Thanks. ljraven
import java.util.*;
public class MortgageArray
{
public static void main(String[] args) throws Exception
{
double[][] mortgage = new mortgage [3][4];
{ {200000, 7, 5.35, 0.0},
{200000, 15, 5.5, 0.0},
{200000, 30, 5.75, 0.0} };
System.out.println("Mortgage amount is \t" + $);
System.out.println("Term of mortgage is \t" + "years");
System.out.println("Interest rate is \t" "%");
System.out.println("Monthly mortgage payment \t" $);
}
}
}
C:\Java\MortgageArray.java:10: not a statement
{ {200000, 7, 5.35, 0.0},
^
C:\Java\MortgageArray.java:10: ';' expected
{ {200000, 7, 5.35, 0.0},
^
C:\Java\MortgageArray.java:10: illegal start of expression
{ {200000, 7, 5.35, 0.0},
^
C:\Java\MortgageArray.java:12: ';' expected
{200000, 30, 5.75, 0.0} };
^
C:\Java\MortgageArray.java:14: ')' expected
System.out.println("Mortgage amount is \t" + 0,0$ );
^
C:\Java\MortgageArray.java:15: ')' expected
System.out.println("Term of mortgage is \t" + 0,1 "years");
^
C:\Java\MortgageArray.java:16: ')' expected
System.out.println("Interest rate is \t" 0,3 "%");
^
C:\Java\MortgageArray.java:17: ')' expected
System.out.println("Monthly mortgage payment \t" 0,4$ );
^
C:\Java\MortgageArray.java:23: 'class' or 'interface' expected
}
^
C:\Java\MortgageArray.java:27: 'class' or 'interface' expected
^
10 errors
Tool completed with exit code 1
:cry: :confused: