Write a Java program and Flowchart that lets the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 10%, with an increment of 1/4.
????ℎ????????? = ?????????? × ????ℎ?????????????? / 1 − 1 (1 + ????ℎ??????????????) ????????????? ×12
????????????? = ????ℎ????????? × ????????????? × 12
SOURCE CODE:
*Please follow the comments to better understand the code.
**Please look at the Screenshot below and use this code to copy-paste.
***The code in the below screenshot is neatly indented for better understanding.
import java.util.Scanner;
import java.lang.Math;
class Loan
{
public static void main (String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter Loan
Amount: ");
double loanAmount =
sc.nextDouble();
System.out.println("Enter Loan
Period in years: ");
double numberOfYears =
sc.nextDouble();
double interest = 5; // 5%
while(interest<=10)
{
double monthlyInterestRate =
interest/100;
//print the data
double
monthlyPayment=loanAmount*monthlyInterestRate/1-(1+monthlyInterestRate)*numberOfYears*12;
double totalPayments =
monthlyPayment * numberOfYears * 12;
System.out.println("Interest:
"+interest+"%, Monthly Payment: "+monthlyPayment+", Total Payments:
"+totalPayments);
//increase by 1/4
interest += (double)1/4;
}
}
}
===============
OUTPUT:
Enter Loan Amount:
15000
Enter Loan Period in years:
2
Interest: 5.0%, Monthly Payment: 724.8, Total Payments:
17395.199999999997
Interest: 5.25%, Monthly Payment: 762.24, Total Payments:
18293.760000000002
Interest: 5.5%, Monthly Payment: 799.68, Total Payments:
19192.32
Interest: 5.75%, Monthly Payment: 837.12, Total Payments:
20090.88
Interest: 6.0%, Monthly Payment: 874.56, Total Payments:
20989.44
Interest: 6.25%, Monthly Payment: 912.0, Total Payments:
21888.0
Interest: 6.5%, Monthly Payment: 949.44, Total Payments:
22786.56
Interest: 6.75%, Monthly Payment: 986.8800000000001, Total
Payments: 23685.120000000003
Interest: 7.0%, Monthly Payment: 1024.32, Total Payments:
24583.68
Interest: 7.25%, Monthly Payment: 1061.76, Total Payments:
25482.239999999998
Interest: 7.5%, Monthly Payment: 1099.2, Total Payments:
26380.800000000003
Interest: 7.75%, Monthly Payment: 1136.64, Total Payments:
27279.36
Interest: 8.0%, Monthly Payment: 1174.08, Total Payments:
28177.92
Interest: 8.25%, Monthly Payment: 1211.52, Total Payments:
29076.48
Interest: 8.5%, Monthly Payment: 1248.96, Total Payments:
29975.04
Interest: 8.75%, Monthly Payment: 1286.4, Total Payments:
30873.600000000002
Interest: 9.0%, Monthly Payment: 1323.84, Total Payments:
31772.159999999996
Interest: 9.25%, Monthly Payment: 1361.28, Total Payments:
32670.72
Interest: 9.5%, Monthly Payment: 1398.72, Total Payments:
33569.28
Interest: 9.75%, Monthly Payment: 1436.16, Total Payments:
34467.840000000004
Interest: 10.0%, Monthly Payment: 1473.6, Total Payments:
35366.399999999994
SCREENSHOT:




Write a Java program and Flowchart that lets the user enter the loan amount and loan...
PYTHON ONLY PLEASE (Financial application: compare loans with various interest rates) Write a program that lets the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8%, with an increment of 1/8. Sample Run Loan Amount: 10000 Number of Years: 5 Interest Rate Monthly Payment Total Payment 5.000% 188.71 11322.74 5.125% 189.29 11357.13 5.250% 189.86 11391.59 ... 7.875% 202.17 12129.97 8.000% 202.76...
Write a program that lets the user enter the total amount of money spent on a credit card for each of 12 months into an array of doubles. The program should calculate and display the total amount of money spent for the year, the average monthly spent, and the months with the highest and lowest amounts. Input Validation: Do not accept negative numbers for monthly credit card charges. If the credit card charge for the month is negative, assume the...
The Problem Design a program that lets the user enter the total rainfall for each of 12 months into an array. The program should calculate and display the total rainfall for the year, the average monthly rainfall, the number of months above and below the average rainfall, and the highest rainfall for each quarter of the year. The Assignment Write a Java program that contains five method/functions as follows: main(). Calls the functions enterRain, rainStats, aboveBelow, and quarterlyRain. enterRain(). Uses...
Program Requirements · The program prompts the user to enter a loan amount and an interest rate. · The application calculates the interest amount and formats the loan amount, interest rate, and interest amount. Then, it displays the formatted results to the user. · The application prompts the user to continue. · The program stops prompting the user for values after taking 3 loan amounts. · The application calculates and displays the total loan and interest amount and ends the program Example Output Welcome to...
Program Specification: This project involves implementing a Java program that performs a calculation of payments associated with loans. The program shall allow a user to enter the following data: annual interest rate the loan (i.e. , number of years), and the loan amount. A GUI like the one below must be used. Loan Calculator Annual Interest Rate: Number of Years Loan Amount: Monthly Payment Total Payment Calculate When the user presses the calculate button, the monthly payment and total amount...
Need pseudocode flowchart only!
Please complete is question as a pseudocode and flowchart for Java. 12.5 (College Loan Payoff Calculator App) A bank offers college loans that can be repaid in 5,10, 15, 20, 25, or 30 years. Write an app that allows the user to enter the amount of the loan and the annual interest rate. Based on these values, the app should display the loan lengths in years and their corresponding monthly payments.
Write a program in C++ that lets the user enter the total rainfall for each of 12 months into an array of doubles. The program should calculate and display the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts. Input validation: Do not accept negative numbers for monthly rainfall figures.
Python: Write a program that lets the user enter a string and displays the letter that appears most frequently in the string, ignore spaces, punctuation, and Upper vs Lower case. Create a list to hold letters based on the length of the user input Convert all letters to the same case Use a loop to check for each letter in the alphabet Have a variable to hold the largest number of times a letter appears, and replace the value when...
Rainfall Statistics Write a program that lets the user enter the total rainfall for each of 12 months (starting with January) into an array of doubles. The program should calculate and display (in this order): the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts. Months should be expressed as English names for months in the Gregorian calendar, i.e.: January, February, March, April, May, June, July, August, September, October, November, December....
Write a python program for the below question? Car Loan If A dollars is borrowed at r% interest compounded monthly to purchase a car with monthly payments for n years, then the monthly payment is given by the formula monthly payment = i / 1 - (1 + i)-12n . A where i = r/1200. Write a program that calculates the monthly payment after the user gives the amount of the loan, the interest rate, and the number of years.