Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions You are working as a computer programmer for a mortgage company that provides loans to consumers for residential housing. Your task is to come

Instructions

You are working as a computer programmer for a mortgage company that provides loans to consumers for residential housing. Your task is to come up with an application to be used by the company's loan officers when presenting loan options to its customers. The application will be a mortgage calculator that determines a monthly payment for loans and produces an amortization schedule for the life of the loan.

The company offers 20, 25, 30, and 40-year fixed loans.

Loan amounts are between 100000 and 250000.

Annual Interest rate must be >= 1.0 and <= 10.0.

Amortize Schedule Creation:

The amortized schedule for the loan must be populated using a recursive function.

Recursion is "a method where the solution to a problem depends on solutions to smaller instances of the same problem" (See resource #1 below).

In programming, this is a function with one or more parameters. This function will do some action, adjust the data received, and see if the exit condition has been met. If the exit condition has not been met, the function calls itself, passing in the new set of data parameters. Like a Yo-Yo, it goes down and down and down until it reaches the end (of the string), then it returns back to the beginning (the hand).

Inputs:

  1. Loan Principle Between 100000 and 250000 inclusive
  2. Annual Interest rate >= 1.0 and <= 10.0.
  3. Loan Term in Years 20, 25, 30, 40

Requirements:

To receive credit for this assignment, certain programming features must be implemented in such a way as to demonstrate your knowledge of formulas, functions, input error checking, proper formatting of outputs, and recursion.

  1. No Global values other than constants are allowed in this and all labs. If you need them global const values are allowed.
  2. Display your name, Lab number, and Lab name on the screen.
  3. Prompt for and accept a valid loan principle amount.
    1. Data type - double
    2. Valid values - between 100000 and 250000 inclusive Non numeric input and invalid numeric values are to be rejected with a warning to the user. See the sample error checking code below. For example, when prompted to enter a number, if the user enters "abc," the program will not be able to process the loan appropriately. If the user enters a number < 100000.0 or > 250000.0 the loan is not to be processed.
  4. Prompt the user to enter an annual interest rate for the loan as a percent.
    1. Data type - double
    2. Valid values - >= 1.0 and <= 10.0 For example, an annual interest rate of 4.5% should be entered as 4.5. Your program will convert it to .045 for calculations. If a non-numeric value or interest rate that is not positive are entered, prompt the user to re-enter the rate.
  5. Prompt the user to enter the term of the loan in years.
    1. Data type - int
    2. Value values - 20, 25, 30, or 40 years. Any other entries should be rejected, and the user should be prompted to re-enter an appropriate value. Be sure to display an error message that clearly tells the user what was wrong.
  6. Calculate the number of monthly payments.
  7. Once the inputs have been entered and validated, your program must calculate the monthly payment for the loan. To receive credit for the loan calculation, you must use a function called calcMonthlyPayment() that receives the principal, monthly interest rate, and number of payments as parameters. The function should return the monthly payment (a double) that is calculated.
  8. In main(), call a function named calcAmortizeSchedule() to develop an amortization schedule for the loan using these specifications:
    1. The column headings shown in the above example must be part of the function that creates and displayes the amortization schedule.
  9. Use an If block to check for the first value of the parameter currentPeriod. Add the column titles in the If block body.
  10. The function must receive as parameters: currentPeriod, totalPeriods, paymentAmount, monthlyInterestRate, currentBalance.
  11. The function MUST be recursive to receive credit for producing the Amortization Schedule.
  12. The function must print out the Amortization Schedule to the screen using good formatting (including spelling and grammar where appropriate). Be sure to pause the output so the user can view the amortize schedule.

the program should check for invalid data such as non-numeric and non-positive entries, as well as values within the specified ranges for principal, interest rate, and term. Use proper indentation and style, meaningful identifiers, and appropriate comments.

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_2

Step: 3

blur-text-image_3

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

Global Strategy

Authors: Mike W. Peng

5th Edition

0357512367, 978-0357512364

More Books

Students also viewed these Algorithms questions

Question

3 > O Actual direct-labour hours Standard direct-labour hours...

Answered: 1 week ago

Question

Identify the major liability loss exposures of business firms.

Answered: 1 week ago