Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two inputs, current price and last month's price (both integers). Then, output a summary listing the price, the change since last month, and the estimated monthly mortgage computed as (current_price * 0.051) / 12.
Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
print('{:.2f}'.format(your_value))
Ex: If the input is:
200000
210000
the output is:
This house is $200000. The change is $-10000 since last month.
The estimated monthly mortgage is $850.00.
Note: Getting the precise spacing, punctuation, and newlines exactly right is a key point of this assignment. Such precision is an important part of programming.
main.py
current_price = int(input())
last_months_price = int(input())
''' Type your code here. '''

Respuesta :

Answer:

current_price = int(input())

last_months_price = int(input())

change = current_price - last_months_price

mortgage = (current_price * 0.051) / 12

print('This house is

Otras preguntas

+ str(current_price) + '. The change is

Otras preguntas

+ str(change) + ' since last month.')

print('The estimated monthly mortgage is ${:.2f}.'.format(mortgage))

Explanation:

Ask the user to enter the current price and last month's price

Calculate the change, subtract last month's price from the current price

Calculate the mortgage using the given formula

Print the results in required format

Otras preguntas

. Leanne is being treated for depression after a breakup with her boyfriend. Her therapist points out that her thoughts, and not the situation itself, are the c
Ying is going out to a pasta dinner. There are 5 types of noodles to choose from and 4 choices of vegetable side. How many different pasta dinners can Ying orde
A hollow sphere of radius 0.200 m, with rotational inertia I = 0.0484 kg·m2 about a line through its center of mass, rolls without slipping up a surface incline
Marta is on vacation with her family. Fill in the blanks with the present progressive form of the verbs in the parenthesis. Mi familia y yo (1) (pasar) las vaca
the length of a rectangle is 2cm more than four times the width. if the perimeter of the rectangle is 84 cm, what are it’s dimensions?
Which sentence reveals the author’s point of view in the passage? Learning to ski when you're an adult can be difficult. And if you are the kind of person who i
University Printers has two service departments (Maintenance and Personnel) and two operating departments (Printing and Developing). Management has decided to a
A slit of width 0.59 mm is illuminated with light of wavelength 474 nm, and a screen is placed 130 cm in front of the slit. Find the widths of the first and sec
Tom's Shoes makes a profit from selling its shoes, provides free shoes to children in countries in need, encourages volunteers to be involved in donations of sh
The secondary coil of a step-up transformer provides the voltage that operates an electrostatic air filter. The turns ratio of the transformer is 46:1. The prim