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

<p>1. Write a basic program to calculate the monthly payment and the total cost

ID: 3638398 • Letter: #

Question

<p>1. Write a basic program to calculate the monthly payment and the total cost for a student loan. The program should input the total amount of the loan, the interest rate and the time to repay.<br />The monthly payments for a loan of loan dollars for m months at a monthly interest rate of interest is:<br />payment=loan[interest(1+interest)^m/(1+interest)^m -1]<br /><br />The interest rate and the time period used in the equation are monthly. Most people have student loans for years. Your program should ask the user the number of years of the loan and then multiply that value by 12 to get the number of months. Interest rates are generally thought of as annual percentages. Your program should read an annual percent, divide it by 100 to get a fraction and then divide it by 12 to get the monthly interest rate.</p>
<p><br />Once you know the monthly payment amount, you can multiply that by the number of months to get the total amount the student will have to pay. If you subtract the original amount of the loan from the total paid, you get the cost of borrowing the money.</p>
<p><br />Imagine you borrow $10,000 a year for four years to finance your education. Student loan rates are now about 3.4% and the maximum payback time is 10 years. Using this data, your program should provide results similar to this:<br />Enter the total amount of the loan &gt;40000.00<br />Enter the annual interest rate as a percent &gt;3.4<br />Enter the number of years to repay &gt;10<br />Monthly payments will be $393.6724264811499<br />Total paid will be $47240.69117773799<br />Cost of the loan is $7240.691177737986</p>

Explanation / Answer

import javax.swing.JOptionPane; public class Program_01 { public static void main(String [] args) { int Runs; do{ String Run_Question = JOptionPane.showInputDialog(null, "How many times,would you like to run" + " the program? (Up to four runs only!)", "Run Question", JOptionPane.QUESTION_MESSAGE); Runs = Integer.parseInt(Run_Question); if( Runs < 0 || Runs > 4) { JOptionPane.showMessageDialog(null, "The number is not valid, try again!", "Error", JOptionPane.INFORMATION_MESSAGE); } }while(Runs < 0 || Runs > 4); Questions(Runs); } public static void Questions(int Runs) { for(int index = 0;index Remain[index] && Remain[index] > 0) { Monthly = Remain[index]; Over = false; } Month += 1; } System.out.println("I am here!" + Month); System.out.println("Payment #" + " " + "Principle" + " " + "Payment" + " " + "APR" + " " + "MPR" + " " + "Interest Payment" + " " + "Principle Payment"); System.out.println("------------------------------------------------------------------------"); for(int index = 0; index
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