CS 021 - Assignment #5 READ THE ENTIRE DOCUMENT-There are ewo programs to submit (thas tuo py file). Lse the specified name for your scripes (shown in parentheses bek). Mortgage Calculator (mortgage.py) Write a morngage cakulator that includes compound innerest The total momgage calculation requires three inputs: principul (in dollan), interest rane, and time (in yecars). Your program shoold have three functions total_mortgage, display title, and main. total mortgage should take the three values as parameterx principal, annual inenest rate, and yean, and it shoukd calculate and display the otal meetgage amount, foematted with comma separatoes, so rwo decimal places. Here's the formula yesa should use in total_nortgage: 100 (-). where a is the sotal amount due, pis the principal, r is the annual interest rane (firsed, and t is the time period in year. This would be the amount you would have to pay if you boerowed the principal the annual innerest ratc for the specified period of years (not amortizod).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Python

 

CS 021 - Assignment #5
READ THE ENTIRE DOCUMENT - There are ewo programs to submit (thus tuo py files). Uise the
specificed name for your sceripes (shown in purentheses bekow).
Mortgage Calculator
(mortgage.py) Write a mortgage cakulator that includes compound innetest. The total mongage
calculation requires three inputs: principal (in dollare), interest rate, and time (in years). Your program
should have three functions: total_mortgage, display_title, and main.
total_mortgage should take the three values as parameters: principal, annual interest rate, and years,
and it should caleulate and display the total mortgage amount, formatted with comma separators, to two
decimal places.
Here's the formula yonu should use in total_mortgage:
where a is the total amount due, pis the principal, r is the annual interest rate (fixed), and t is the time
period in years. This would be the amount you would have to pay if you borrowed the principal ar the
annual interest rate for the specified period of years (not amortized).
Your display title function sbould simply display "Mortgage Calculatoe", as shoen in the example
below.
Your main function should first call the display title function, then prompe for three values,
using three separate while koops to ensure valid input. Principal should be a positive float, interest rate
should be a float greater than I and less than 10, and years should be a positive integer berween 5 and 30
(inclusive). The main function should then call total_mortgage and pass the three values
Example:
Mortgage Calculator
Principal S: -5
Principal S: 300000
Interest rate t: 3.375
Term (years): 7000
Term (years): 30
Amount: $812,057.78
Transcribed Image Text:CS 021 - Assignment #5 READ THE ENTIRE DOCUMENT - There are ewo programs to submit (thus tuo py files). Uise the specificed name for your sceripes (shown in purentheses bekow). Mortgage Calculator (mortgage.py) Write a mortgage cakulator that includes compound innetest. The total mongage calculation requires three inputs: principal (in dollare), interest rate, and time (in years). Your program should have three functions: total_mortgage, display_title, and main. total_mortgage should take the three values as parameters: principal, annual interest rate, and years, and it should caleulate and display the total mortgage amount, formatted with comma separators, to two decimal places. Here's the formula yonu should use in total_mortgage: where a is the total amount due, pis the principal, r is the annual interest rate (fixed), and t is the time period in years. This would be the amount you would have to pay if you borrowed the principal ar the annual interest rate for the specified period of years (not amortized). Your display title function sbould simply display "Mortgage Calculatoe", as shoen in the example below. Your main function should first call the display title function, then prompe for three values, using three separate while koops to ensure valid input. Principal should be a positive float, interest rate should be a float greater than I and less than 10, and years should be a positive integer berween 5 and 30 (inclusive). The main function should then call total_mortgage and pass the three values Example: Mortgage Calculator Principal S: -5 Principal S: 300000 Interest rate t: 3.375 Term (years): 7000 Term (years): 30 Amount: $812,057.78
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Program on Numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education