Question: Mortgage Calculator (MortCalc) class should have one default constructor that initializes the class variables (the amount of the loan (principle), the annual interest rate,
Mortgage Calculator (MortCalc) class should have one default constructor that initializes the class variables (the amount of the loan (principle), the annual interest rate, and the number of years of the loan) to "safe" values. The class should have the principle, interest, years values, as well as the total loan cost, total interest paid, and monthly payment. Write the class with individual Set functions for the three input valued (i.e, the amount of the loan (principle), the annual interest rate, and the number of years of the loan), and individual Gets for the three outputs (total loan cost, total interest paid, and monthly payment). There should be a GetFormattedString that return a string with a complete description of the calculated loan information This class has a private Calculate function that computes all the loan values. There are no cout or cin statements in this class. Following is the equation for computing the monthly payment: M-Pi/[q (1-[1+ (q)])] Where Mmonthly payment P=principle of the loan (amount borrowed) i interest rates where 5% is 0.05 n number of years q=number of payments per year Remember when you write a class, you are not guaranteed that the programmer will call the public functions in any given order. Your programmer could make a MortCalc object and then call GetFormattedString. Be sure that the constructor does its job and initializes the values to something "safe" so you don't run the risk of your program crashing or returning "trash" from the Get functions. Your Set functions will all need to call the Calculate function to insure the data is updated if any one value changes. Write the Bank Loan Officer class (can be named with a shorter name if you'd like, such as LoanOfficer) that is described here, and use the Mortgage Calculator class that was described above. The Loan Officer's job is to determine whether or not the user qualifies for a mortgage loan based on the user's requested amount to borrow, monthly income (net, i.e., after taxes), and monthly expenses. For this program, our LoanOfficer class will have a fixed interest rate of 5.0% and term of loan being 30 years. The LoanOfficer has a MortCalc object as a private class member. This MortCalc object's job is to do the calculations as described in Mortgage Calculator class. The LoanOfficer class will have a default constructor which sets the fixed interest rate and fixed number of years into class members. It also performs other, necessary initializations, including building the introductory, welcome string. This class also has private data for the monthly income, monthly expenses, amount to borrow. There is a bool for the loan approval (true = yes, false = no). This class contains public Ser functions for the net monthly income, expenses, and amount of money that the user is requesting to borrow. The Loan Officer class also has a private Calculate function that uses the MortCalc object to determine the monthly payment and whether or not the loan is approved. The rule for loan approval is this: if the requested loan monthly payment and monthly expenses total (i.e., added together) is greater than 50% of the net monthly income, the loan is NOT approved. There are two Get functions with the LoanOfficer class. The GetIntro) returns a string that has a "welcome" type message that contains the name of the Banking Institution, as well as a statement telling the user what the interest rate and number of years are. The GetLoan Approval() function returns a neatly formatted string with the results of the loan application. This string needed to include the following information: -Loan approval status (yes or no) If the loan is approved, report the details of the loan, including loan amount, interest rate, monthly payment, total loan and total interest. End with a Congratulations message, and state that we're looking forward to doing business with the user. If the loan is not approved, show the income versus monthly payment and expenses does not meet the 50% criteria net income that is necessary for this institution to approve this loan The main function should write your header, and create one LoanOfficer object. Then show the intro from the Loan Officer and begin a do while loop that requests information from the user and reports loan approval status. Continue the process until the user is finished doing loan requests. NOTE: There are no cout < < or cin>> statements in either the MortCalc class OR the LoanOfficer class. All input/output is done in main. Values are set into the class objects or retrieved by the use of get functions. Also, separate interface from implementation.
Step by Step Solution
3.39 Rating (152 Votes )
There are 3 Steps involved in it
include include include using namespace std class mortcal float principle float interest int nYears float totalloan float totalinterestpaid float mont... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
635d96ba273cc_177035.pdf
180 KBs PDF File
635d96ba273cc_177035.docx
120 KBs Word File
