Financial Application: Compound Value

less than 1 minute read

The code has been modified slightly and now uploaded to the site.

Question

<— Return Home

213.cpp

#include <iostream>
using namespace std;

int main(){
    double amount;
    double monthly_interest_rate = 0.00417;
    double subAmount = 0;

    std::cout << "Enter the monthly saving amount: \n";
    std::cin >> amount;

    for (int i = 0; i < 6; i++){
        subAmount = (amount + subAmount) * (1 + monthly_interest_rate);
    }

    std::cout << "After the sixth month, the account value is " << subAmount;
}

<— Return Home