### Investment amount, annual interest rate, months

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354`` ``````#include using namespace std; int main() { double investmentAmount; double interestRate; double months; double monthlyInterest; double interestEarned; double total; cout << "The minimum investment is \$10,000.00." << endl; cout << "Enter the amount of the investment: "; cin >> investmentAmount; if (investmentAmount < 10000.00) { cout << "Error, the minimum investment is \$10,000.00." << endl; cout << "Enter the amount of the investment: "; cin >> investmentAmount; } cout << "Enter the annual interest rate: "; cin >> interestRate; if (interestRate < 0) { cout << "Error, the interest rate should be positive." << endl; cout << "Enter the annual interest rate: "; cin >> interestRate; } cout << "Enter the number of months of the investment: "; cin >> months; if (months < 0) { cout << "Error, the number of months should be positive." << endl; cout << "Enter the number of months of the investment: "; cin >> months; } monthlyInterest = ((interestRate / 12.0) / 100.0); interestEarned = (investmentAmount * monthlyInterest); total = (investmentAmount + interestEarned); cout << "After 12 months your investment of \$" << investmentAmount << " will be worth \$" << total << "." << endl; return 0; } // end function main. ``````

Ask the user for the amount of the investment
Get a minimum investment amount of \$10,000 from the user
Ask the user for the annual interest rate
Get a non-negative annual interest rate from the user
Ask the user for the months of the investment
Get a non-negative number of months from the user
Calculate the monthly interest rate by dividing the annual interest rate by 12 and then dividing the resulting value by 100
Save the initial investment amount in investment balance
Repeat for the number of months of the investment
Calculate the interest earned by multiplying the investment balance by the monthly interest rate
Increase the value in the investment balance by the interest earned
Display a message indicating the future value of the investment stored in investment balance

I have everything working except finding the interest earned and calculating the monthly interest rate.
Topic archived. No new replies allowed.