Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please only answer with example code 1. You will develop a Python program which calculates details for a mortgage loan for one or more houses

Please only answer with example code
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
1. You will develop a Python program which calculates details for a mortgage loan for one or more houses based on the input variables described in detail below. 2. The program will first print a simple welcome message (use the provided strings), and then repeatedly ask if the user wishes to process another mortgage. If the user's response is the letter Y or the letter y, the program will proceed with the steps to calculate the values associated with a new set of inputs for a mortgage loan. If the user's response is anything else, the program will quit. 3. When the user chooses to process a mortgage loan, the program will prompt the user to enter the desired location of the house, the desired square footage of the house, the user's maximum monthly payment, the user's expected down payment, and the current APR. You should use the prompts provided for each of these inputs in the file "strings. txt". Users will be advised to enter as much information as possible or " NA " if they cen't have a value to input. The program will behave in response to which values are present and which are missing. 4. For each of the inputs, handle the input as follows. For location, the user must provide one of the following cities: Seattle, San Francisco, Austin, East Lansing. The starter file contains the corresponding property tax rates and real estate prices per square foot for each of these locations. If the user types any other value, use the average national values for those two metrics and display the unknown location message. For square footage, you may assume the user has typed a positive value or "NA". If the value is numerical, convert it to a float; otherwise, you will compute a maximum square footage given the values of the other variables (presuming those values are valid). The square footage will be multiplied by the price per square foot based on the location selected. the value is numerical, convert it to a float; otherwise, you will compute the details of the mortgage loan given the values of the other variables (presuming those values are valid). For down payment, you may assume the user has typed a positive value or " NA ". If the value is numerical, convert it to a float; otherwise, you should assign the variable a value of 0 . You will deduct the down payment from the total cost of the house to get the amount of the mortgage loan. For APR, you may assume the user has typed a positive value between 0 and 100 or "NA". If it is numerical, convert it to a float and store it for use in your calculations (i.e., not as you would display it, nor as the user typed it); otherwise, assign the value stored in the APR 2023 constant that has been provided. Note: if neither desired square footage nor maximum monthly payment have been provided, display the message for not enough information. 5. If the user has provided a square footage, you should estimate the home cost for the given location based on the corresponding values. You will also need to calculate the principal value based on the estimated home cost and the down payment. Mortgage loan information will be displayed containing all the provided information as well as the monthly taxes and the monthly payment. The message should be displayed like the one shown below. If the user has provided a maximum monthly payment in addition to the square footage, print a message telling the user whether they can or cannot purchase the home described given their maximum monthly payment amount. An example is shown below. Finally, ask the user if they wish to see the amortization table for the mortgage loan. An amortization table shows how the monthly payment will be allocated each month. Some of the payment is directed to pay off the interest owed on the loan, and the rest goes to reduce the overall balance of the loan. The amount of interest is based on the current balance remaining and the monthly interest rate. Use proper formatting for the amortization table with a header and well-spaced values for month number, interest payment, principal payment, and remaining balance (see examples). 6. If the user has not provided the square footage but has provided the maximum monthly payment, calculate the maximum square footage that their monthly payment can afford in the location specified. Report this as shown below. Hint: use the formula below and solve for the principal first

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

More Books

Students also viewed these Databases questions