Untitled

 avatar
unknown
plain_text
5 months ago
662 B
12
Indexable
#include <iostream>
using namespace std;

int main() {
    int currentPrice, lastMonthPrice;

    // Input current price and last month's price
    cin >> currentPrice >> lastMonthPrice;

    // Calculate the change in price
    int change = currentPrice - lastMonthPrice;

    // Calculate the estimated monthly mortgage
    double estimatedMortgage = (currentPrice * 0.051) / 12;

    // Output the results
    cout << "This house is $" << currentPrice << ". The change is $" << change << " since last month." << endl;
    cout << "The estimated monthly mortgage is $" << static_cast<int>(estimatedMortgage) << "." << endl;

    return 0;
}
Editor is loading...
Leave a Comment