Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2012
    Posts
    1

    Need help answer this question

    Write a program to compute the monthly payment (M) on a loan given the loan amount (P), the annual percentage rate of interest (r), and the number of monthly payments (N). The program should allow the user to input P, r, and N, and would then compute and display M using the formula:
    M = P * R * (1 + R)^N/((1 + R) ^N – 1)

    Where R = r/1200, the monthly rate of interest expressed as a decimal.

    Note that carat (^) means "raised to the power". Example t^4 means "t raised to the power 4."
    2^4 = 2*2*2*2 = 16.

    Your analysis should be clearly written and demonstrate your thought process and steps used to analyze the problem. Be sure to include what is the required output? What is the necessary input and how you will obtain the required output from the given input? Also, include your variable names, definitions and data types. Be sure to describe the necessary formulas and sample calculations that might be needed.

    2. Using a similar approach as the example provided in section 2.2(textbook page 78) for “The Sale Price Program continued”, provide your program design for the program you analyzed for calculating monthly payment above. Be sure to describe the fundamental tasks needed to solve the problem so you can use a modular design. Provide pseudocode of your overall design that includes the Main module and the order of the module calls (see page 82 for an example). Finally, list all of your pseudocode for each module (See example 2.6 on page 83 as an example).

    3. Using a similar approach as the example provided in section 2.3 (textbook page 86) add comments to your pseudocode (see example 2.8 on pages 87-88). Then, prepare at least 4 sets of input data (Test data) along with their expected output for testing your program. Your test data can be presented in the form of a table as follows (note: feel free to adapt to your design):

    Example application test data:
    Loan Amount (P) Annual Interest Rate (r) Number of monthly payments (N) Monthly interest rate (R) Expect output: Monthly payment (M)

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    you might not have noticed, being a new member of this site, that we don't do homework assignments here
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •