Write a program Loan.java that calculates loan information when given a loan
amount, the number of monthly payments, and the yearly loan interest. The loan
information should include
The monthly payment
The schedule of payments
The number of months to save the amount (instead of taking a loan)
The following are formulas to calculate the monthly payment and the number of
months to save the loaned amount.
monthly payment ? loan amount number of months yearly interest %
number of months to save? saving amount yearly interest % monthly payment
For instance, the following is a possible output for a call of the form ‘java Loan
10000 12 6.5’.
If the program is invoked with the command ‘java Loan 10000 12 6.5’ then
The code Double.parseDouble(args[0]) provides the literal
10000.0 of type double
The code Integer.parseInt(args[1]) provides the literal 12 of
type int
The code Double.parseDouble(args[2]) provides the literal 6.5 of
type double.
If questions in an email of yours refer to a program you wrote, please don’t
include the program in the email. Instead, put the program in your WWW
directory with an extension .txt added to the file name (e.g., Foo.java.txt),
change the access mode of the program to 644, and provide just the file name in
the email.
Submit your source file ‘Loan.java’ with the ‘submit c214aa lab4Loan.java’ command.