Ask Question
8 September, 10:52

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 (currentPrice * 0.045) / 12.

+4
Answers (2)
  1. 8 September, 12:41
    0
    integer currentPrice

    integer lastMonthPrice

    integer changeLastMonth

    float mortagage

    //Reading input

    currentPrice = Get next input

    lastMonthPrice = Get next input

    //Calculating price change

    changeLastMonth = currentPrice - lastMonthPrice

    //Calculating mortagage

    mortagage = (currentPrice * 0.045) / 12

    //Printing output

    Put "This house is $" to output

    Put currentPrice to output

    Put "/nThe change is $" to output

    Put changeLastMonth to output

    Put " since last month." to output

    Put "/nThe estimated monthly mortgage is $" to output

    Put mortagage to output
  2. 8 September, 13:32
    0
    current_price = int (input ("Enter current price: ")) l_price = int (input ("Enter last month price: ")) for i in range (1, 13) : print ("Current price: $" + str (current_price) + ", Last month price: $" + str (l_price)) l_price = current_price current_price + = (current_price * 0.045) / 12

    Explanation:

    The solution code is written in Python 3.

    Firstly, get user input for current price and last month price (Line 1 - 2).

    Create a for loop to traverse through the number from 1 to 12. In the loop, print the current price and last month price (Line 5). Before proceeding to the next round of loop, set the current_price to l_price and then apply the given formula to recalculate the estimated monthly mortgage and assign it to current_price (Line 6-7).
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two inputs, ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers