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

Write a program to input data relevant to an automobile loan and then, after com

ID: 3826982 • Letter: W

Question

Write a program to input data relevant to an automobile loan and then, after computing the amortized monthly payment, print a table showing the monthly information indicated below. You must use methods for the separate tasks! (e.g.) Input of data, computation of payment, output of headers, compute monthly data, and output monthly data. A is amortized payment amount (rounded: use formula once only) p is the principal i is the annual rate/# of payments per year n is total number of payments of loan A = p*i*(1+i)^n/(1+i)^n - 1 Find the following for each payment period: payment number amount of interest due for that payment (rounded) amount of payment applied toward principal remaining balance after payment has been made Allow 24 payments per page, making sure that you put the page and column headers on every page. The sample output below indicates the values that must be output each time a payment is made. Finally, the total interest paid over the life of the loan must be accumulated throughout the processing portion of the program and its value must be printed at the bottom of the last page of output. This program should be well written and well documented both internally and externally

Explanation / Answer

import java.io.*;
import java.util.*;

public class Amortized
{
   private int len;
   private double pricipal;
   private double interest;
   private int loan_year;
   private int payments_year;
   private int payment_no[];
   private double amt_interest[];
   private double payment[];
   private double remain[];
   private double payment_amount;
   private double total_interest;
   public void input()
   {

       System.out.println("Enter the data :");
       Scanner s=new Scanner(System.in);
       pricipal=s.nextFloat();
       interest=s.nextFloat();
       loan_year=s.nextInt();
       payments_year=s.nextInt();
       len=loan_year*payments_year;
       payment=new double[len];
       remain=new double[len];
       amt_interest=new double[len];
       payment_no=new int[len];
   }
   public void computation()
   {
       payment_amount=(pricipal*interest*payments_year)/100;
       payment_amount+=pricipal;
       int counter=0;
       total_interest=0;
       double amortized=pricipal*interest*Math.pow((1+interest),len);
       amortized/=(Math.pow((1+interest),len)-1);
       for(int i=0;i<len;i++)
       {
           payment_no[i]=i+1;
           amt_interest[i]=Math.round(interest);
           payment[i]=amortized;
           payment_amount-=amortized;
           remain[i]=payment_amount;
           total_interest+=amt_interest[i];
       }
   }
   public void output_headers()
   {
       System.out.println(" Auto Loan Payment Table");
       System.out.println("Principal = "+pricipal+" Annual Rate = "+interest+" Total Payments = "+ len+" Payment amounts = "+payment_amount);
       System.out.println("Payment Number Interest Due Toward Pricipal Remaining Balance ");

   }
   public void output_monthly()
   {
       for (int i=0;i<len;i++)
       {
           System.out.println(payment_no[i]+" "+amt_interest[i]+" "+payment[i]+" "+remain[i]);
       }
       System.out.println(" Total Interest = "+total_interest);
   }
   public static void main(String args[])
   {
       Amortized a=new Amortized();
       a.input();
       a.computation();
       a.output_headers();
       a.output_monthly();
   }
}

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