Ask Question
29 August, 08:27

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. in coral

+2
Answers (1)
  1. 29 August, 08:51
    0
    Complete Question

    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. 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 $750.

    Use Coral Programming Language

    Answer:

    / / Program is written in Coral Programming Language

    / / Comments are used for explanatory purpose

    / / Program starts here

    / / Variable declaration

    int currentprice

    int prevprice

    int change

    float mortgage

    Put "Enter current price to output" to output

    currentprice = Get next input

    Put "Enter last month price to output" to output

    prevprice = Get next input

    / / Calculate Change since last month

    change = currentprice - prevprice

    / / Calculate Monthly Mortgage

    mortgage = currentprice * 0.045 / 12

    / / Print Results

    Put "This house is $" to output

    Put currentprice to output

    Put "/n" to output

    Put "This change is $" to output

    Put change to output

    Put "/n" to output

    Put "This house is $" to output

    Put currentprice to output

    Put "since last month/n" to output

    Put "This estimated monthly mortgage is $" to output

    Put mortgage to output

    / / End of Program
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a program with two inputs, current price and last month's price (both integers). Then, output a summary listing the price, the change ...” in 📗 Engineering if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers