183k views
1 vote
House real estate summary 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.

User Anthi
by
6.5k points

1 Answer

3 votes

Answer:

current_price = int(input("Enter the current price: "))

last_months_price = int(input("Enter the last month's price: "))

print("This house is $" + str(current_price))

print("The change is $" + str(current_price - last_months_price) + " since last month")

print("The estimated monthly mortgage is ${:.2f}".format((current_price * 0.051) / 12))

Step-by-step explanation:

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

Print the current price

Print the change in the price, subtract the last month's price from the current price

Print the estimated monthly mortgage, use the given formula to calculate, in required format

User Jhurtado
by
6.6k points