Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Code in C++ CSE 110-Lab #6 Car Loan Program (call-by-reference/value and void functions) Write a multi-file program for a car dealer that calculates the monthly
Code in C++
CSE 110-Lab #6 Car Loan Program (call-by-reference/value and void functions) Write a multi-file program for a car dealer that calculates the monthly payment and total payback amount for the inputs of loan amount, interest rate, and loan duration in months. Allow the user to run it multiple times without restarting the program. The program must have the following four (4) functions called from main and located in a header file: A function for getting and validating the input (input must be reasonable) 2. 1. A function to compute and return the monthly payment amount 3. A function to compute the total interest paid-in and the total payback amount 4. A function to produce the output with the amounts right aligned The output will be formatted exactly as shown below (use setw(x) with the introduction banner as shown. Variables may not be declared globally, and must be passed by value when appropriate, and passed by reference when appropriate. All functions must be called from main The equation for determining the monthly payment for a loan is: Monthly Loan Payment Formula: The formula is MP L'(/1(1+r)). MP monthly payment amount L-principal, meaning the amount of money borrowed effective interest rate. Note that this is usually not the annual interest rate; see below. N total number of payments Calculate the effective interest rate (r) Most loan terms use the "nominal annual interest rate," but that is an annual rate. Divide the annual interest rate by 100 to put it in decimal form, and then divide it by the number of payments per year (12) to get the effective interest rate. For example, if the annual interest rate is 5%, and payments are made monthly (12 times per year), calculate 5/100 to get 0.05, then calculate rate 0.05/12 0.004167Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started