Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You have just purchased a stereo system that cost $1000 on the following credit

ID: 3825261 • Letter: Y

Question

You have just purchased a stereo system that cost $1000 on the following credit plan (as test case #1): No down payment, annual simple interest rate of 18.00% (and hence 1.50% per month or 0.015 per month), and monthly payments of $50.00. The monthly payment of $50.00 is used to pay the interest and whatever is left is used to pay part of the remaining debt. Hence, the first month you pay 1.5% of $1000 in interest, which is $15.00. So, the remaining $35.00 (=$50.00 -$15.00) is deducted from your loan balance, which leaves you with a debt of $965.00 (=$1000.00 - $35.00). The next month, you pay interest of 1.5% of 965, which is $14.48. Hence, you can deduct $35.52 (=$50.00 - $14.48) from your loan balance. You may use the while loop such as: while (loanBalance >= monthPayment) {...}. When the loanBalance is less than the monthPayment, you need to compute the final payment amount, which should be the loanBalance plus its interest of one month. For example, if your last-month's loan balance is $47.12, which is less than the monthly payment of $50.00, then its final payment should be $47.83 because $47.12 plus its interest $0.71 (= 47.12 * 0.015) is $47.83. Please make sure that your report is very user-friendly and easy to read. Your report must first show the following headline: Your report must then have the following 5 columns for each month's payment until the loan balance is equal to 0 or less than 0.10: Your report must have the following line at the end to show the total interest amount paid: Total Amount of Interest Paid: $ ____ Your loan payment report for test case #1 may look as follows:

Explanation / Answer

package loanInterest;

import java.text.DecimalFormat;

public class CalculateInterest {
   public static void main(String[] args) {
       double totalCost=1000;
       int interestRate=18;
       double monthlyPayment=50;
       double loanBalance=1000;
       double interestPaid=0;
       System.out.println("Loan Amount: $"+totalCost+" "+"Annual Interest Rate: "+interestRate+"% "+"Monthly Payment: $"+monthlyPayment);
       System.out.println("Month# Month Payment interest Paid Debt Paid Loan Balance");
       System.out.println("====== ============= ============= ========= ============");
       int i=0;
       DecimalFormat df=new DecimalFormat("0.00");
       while(loanBalance>=monthlyPayment){
           double monthlyInterest=loanBalance*0.015;
           double debtPaid=monthlyPayment-monthlyInterest;
           loanBalance=loanBalance-debtPaid;
           interestPaid+=monthlyInterest;
           i++;
           System.out.println(i+" $"+monthlyPayment+" $"+df.format(monthlyInterest)+" $"+df.format(debtPaid)+" $"+df.format(loanBalance));
          
       }
       interestPaid+=loanBalance;
       i++;
       System.out.println(i+" $"+df.format(loanBalance)+" $"+df.format(loanBalance)+" $"+df.format(loanBalance)+" $0.00");
       System.out.println("Total Interest Paid: "+df.format(interestPaid));
   }
}

Output

Loan Amount: $1000.0   Annual Interest Rate: 18%   Monthly Payment: $50.0
Month#    Month Payment    interest Paid    Debt Paid    Loan Balance
======    =============    =============    =========    ============
1    $50.0    $15.00    $35.00    $965.00
2    $50.0    $14.47    $35.52    $929.48
3    $50.0    $13.94    $36.06    $893.42
4    $50.0    $13.40    $36.60    $856.82
5    $50.0    $12.85    $37.15    $819.67
6    $50.0    $12.30    $37.70    $781.97
7    $50.0    $11.73    $38.27    $743.70
8    $50.0    $11.16    $38.84    $704.85
9    $50.0    $10.57    $39.43    $665.42
10    $50.0    $9.98    $40.02    $625.40
11    $50.0    $9.38    $40.62    $584.79
12    $50.0    $8.77    $41.23    $543.56
13    $50.0    $8.15    $41.85    $501.71
14    $50.0    $7.53    $42.47    $459.24
15    $50.0    $6.89    $43.11    $416.13
16    $50.0    $6.24    $43.76    $372.37
17    $50.0    $5.59    $44.41    $327.95
18    $50.0    $4.92    $45.08    $282.87
19    $50.0    $4.24    $45.76    $237.11
20    $50.0    $3.56    $46.44    $190.67
21    $50.0    $2.86    $47.14    $143.53
22    $50.0    $2.15    $47.85    $95.68
23    $50.0    $1.44    $48.56    $47.12
24    $47.12    $47.12    $47.12    $0.00
Total Interest Paid: 244.24

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote