Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

only the part 2 of the problem is what i am struggling wit. CSE 110-Lab #6 Car Loan Program (call-by-reference/value and void functions) Write a

image text in transcribed
image text in transcribed
image text in transcribed
only the part 2 of the problem is what i am struggling wit.
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 .1 The program must have the following four (4) functions called from main and located in a header file: 1. A function for getting and validating the input (input must be reasonable) A function to compute and return the monthly payment amount 2. 3. A function to compute the total interest paid-in and the total payback amount A function to produce the output with the amounts right aligned 4. The output will be formatted exactly as shown below (use setwx)) 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 Mps L . ( r / (1-(1 + r)" MP monthly payment amount L principal, meaning the amount of money borrowed r-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.004167 Use the cmath library for the power function... finclude ccmath> If the user runs the program again, use the following to clear the console window: #include system("CLS" 2/ CSE 110-car Loan Program PROJECT #1-File handling, Loops, and Functions Modify the Car Loan program that computed car loan information (or create a new Project) to read the input values from a file called loanData.txt. The program will read a set of values, compute the results, and write the results to a file called yourName.txt and display until the end of the file is reached. The data is provided on the next page The them on the output console. Then read another set of data etc. program must have at least four (4) functions in a header file: one for opening the files with file failure ne to compute the payment amount, one to compute the total interest paid-in and the total payback amount, and at least one for the output. The loop that reads data and calls the functions should be in main. Create the input file (data on next page) named "loanData.txt . The input and output streams must be declared in main and passed as needed to functions. . The program must read the data from the data file "loanData.txt" . There should be a loop in main that reads data and calls the functions to compute the values and calls the output function, then reads another set of data etc. until the end of file is reached . The program must produce the required output to the console window and to a file "your name.txrt . The output must be as shown below both in the console window and the output file Main will close both of the files before returning zero Be sure to output "Project #1 and your name" at the top as shown below ayrment amount is in the previous lab instructions. Note that when interest is 0% The equation for the monthly p there is special handling for some computations. t Formatting for the display and output file are to be exactly as shown below including your name. EABCC Spring 2019ACSE 110 1021CSE 110 Labs NEW Lab 1234Project 1 Car L.. Project #1 - First Name Last Name Loan Amount Honthly Payment Total Interest Payback Amount $10000.00 225. 79837.95 $10837.95 3500.00 150.74 117.86 3617.86 $14500.00 428.74 934.75 $15434.75 5600.00 162.85 262.77 $ 0.00 $1162.99 s 310.74 3623.40 $5862.77 $27436.00 $11161.99 $22373.40 $27436.00 $457.27 9999.00232.54 $18750.00 Process returned 0 (0x0) execution time 0.203 s Press any key to continue. he and test against the output shown abov precision for both types of output. e using this data. The input data order is loan, interest rate, and duration in months. Use Be sure to add a cariage return at the end of the data below (an extra blank line) in your text file. 10000 48 3500 3.2 24 14500 4.1 36 5600 36 27436 0 60 5.5 48 18750 72

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Office 365 For Beginners 2022 8 In 1

Authors: James Holler

1st Edition

B0B2WRC1RX, 979-8833565759

Students also viewed these Databases questions