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

On September 1, the board of directors of Colorado Outfitters, Inc., declares a stock dividend on its 10,000, $1 par, common shares. The market price of the com
The board of directors of a corporation must select a president a secretary and a treasurer in how many possible ways can this be accomplished if there are 22 m
A truck driver getting paid more than a school teacher is due to ________. a.glass ceiling in the job market b.discriminatio
a bullet is dropped from the same height when another bullet is fired horizontally they will hit the ground
8. Teo makes a necklace of x wooden beads at $0.50 each and 6 glass beads at $1.25 each. The average cost of the beads in the necklace is $0.75. Write an equati
Kara gets an F on her social psychology exam. Then she goes home and gets into an argument with her roommate, Lee. Lee assumes Kara is yelling at him because sh
A male Flagus fly with the Barkus phenotype is crossed with a female who has the wild-type phenotype. A second cross is performed in which the female Flagus fly
The rate law of a certain reaction is rate=k[X][Y]. The units of k, with measured in seconds, is A.) s^-1 B.) M^-1 s^-1 C.) M^-2 s^-1 D.) M^-1
Gisela is suffering from a condition that involves thickening of the lenses of her eyes. This causes her vision to become cloudy or distorted. Identify the cond
A recipe for a pan of brownies requires 1 ½ cups of milk, 2/3 cups of sugar, and 1 1/5 cups of oil. How many cups of ingredients will there be in the mixing Bow