Ask Question
2 August, 07:49

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.

+1
Answers (2)
  1. 2 August, 07:56
    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. 2 August, 08:21
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers