//do comment if any problem arises
//code should be something like
#include <iostream>
#include <cmath>
#include <string>
#include <fstream>
using namespace std;
//this funciton returns choise of user
int menu()
{
cout << "\nEnter (1) to calculate your loan monthly payment";
cout << "\nEnter (2) to calculate your loan monthly payment & write to a file\n";
int choise;
cin >> choise;
//invalid choise
if (choise != 1 && choise != 2)
return menu();
return choise;
}
//this function caculates monthly payment
double calculate_monthly_payment(double P, double r, int t)
{
double A;
A = P * pow(1 + r, t);
A /= t;
return A / 12;
}
int main()
{
string filename = "output.txt";
ofstream outfile(filename, ios::app);
int choise = menu();
string name, Address, Phone;
//principal amount
double P, fixed_monthly_payment,r;
//interest rate
int t;
//read Borrower's name
cout << "Borrower's Name: ";
cin.ignore();
getline(cin, name);
//read Borrower's address
cout << "Borrower's Address: ";
cin.ignore();
getline(cin, Address);
//read Borrower's phone
cout << "Borrower's Phone number: ";
cin.ignore();
getline(cin, Phone);
cout << "Loan Amount: ";
cin >> P;
//read interest rate
cout << "Interest Rate (APR): ";
cin >> r;
r/=100;
//read number of years
cout << "Number of years the amount is deposited or borrowed for: ";
cin >> t;
fixed_monthly_payment = calculate_monthly_payment(P, r, t);
cout << "Fixed Monthly payment for your loan is: " << fixed_monthly_payment;
if (choise == 2)
{
outfile << "Borrower's Name: " << name << endl;
outfile << "Borrower's Address: " << Address << endl;
outfile << "Borrower's Phone: " << Phone << endl;
outfile << "Loan Amount: " << P << endl;
outfile << "Interest Rate: " << r << endl;
outfile << "Fixed Monthly Payment: " << fixed_monthly_payment << endl;
}
outfile.close();
}
Output:

Output file output.txt:

c++ and please add tables and everything and make sure program is complete. Write a menu...
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...
Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgageand the user's selection from a menu of available mortgage loans:•7 years at 5.35%•15 years at 5.5%•30 years at 5.75%Use an array for the mortgage data for the different loans. Read the interest rates to fill the array from a sequential file. Display the mortgage payment amountfollowed by the loan balance and...
Write a contacts database program that presents the user with a menu that allows the user to select between the following options: (In Java) Save a contact. Search for a contact. Print all contacts out to the screen. Quit If the user selects the first option, the user is prompted to enter a person's name and phone number which will get saved at the end of a file named contacts.txt. If the user selects the second option, the program prompts...
In C. Thank you!
Bank
Write a
program to calculate the monthly payment on a loan given the loan
amount, interest rate and the number of years to pay off the loan.
Then add a function to print an amortization schedule for that
loan. Create a class to save the current balance and the rest of
the data as private data. Add member functions to make a payment
and to print the amortization report.
Use the following class header. Class...
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.
The program is in python :)
Write a code program to calculate the mortgage payment. The equation for calculating the mortgage payment is: M = P (1+r)n (1+r)n-1 Where: M is your monthly payment P is your principal r is your monthly interest rate, calculated by dividing your annual interest rate by 12. n is your number of payments (the number of months you will be paying the loan) Example: You have a $100,000 mortgage loan with 6 percent annual...
Overview Module 3 Assignment 2 features designing a program using pseudocode and then completing the program in Python using strings. M3Lab2 asks you to write a Mortgage Loan Calculator. Each lab asks you to write pseudocode that plans the program’s logic before you write the program in Python and to turn in three things: 1) the pseudocode, 2) a screenshot of the output, and 3) the Python program. Instructions Pseudocode and Python Program with Strings M3Lab2.txt has some of the...
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...
THE PROBLEM: The nice folks from the Lion Lending Company have hired you to write some software that will process their daily loan information. The data will come from a text file that has the following format: The first line will contain an integer: number of loan applications There will be two rows for each of the customers First line will be the customer's (1) first name and (2) last name, separated by a space (assume there is no spaces...
Please make a JAVA program for the following using switch structures Write a program that simulates a simple Calculator program. The program will display menu choices to the user to Add, Subtract, Multiply and Divide. The program will prompt the user to make a selection from the choices and get their choice into the program. The program will use a nested if….else (selection control structure) to determine the user’s menu choice. Prompt the user to enter two numbers, perform the...