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

Respuesta :

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