Alright, to start with, i know i totally suck at this but i need help. I am supposed to write a program in which a user enters an amount of "$" and it will calculate when it will take for the money to become in to $5000 or more. I'll just show you the question.....
/* Program: $5,000.00 or more
Date: 12/14/13
Description: This programs calculates when it will take for money to become $5,000.00 or greater. */
#include <cstdlib>
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
// Declaration of Variables and Constants
double totalAmount = 0;
double amount = 0;
double rate = 0.075;
double counter = 0;
// Input
cout << "Enter amount of money you are investing: ";
cin >> amount;
cin.ignore();
totalAmount = amount;
while (totalAmount < 5000)
{
counter++;
totalAmount = totalAmount + (totalAmount * rate);
}
cout << "It will take " << counter << " years for the savings account to be worth $ " << totalAmount << endl;
cout << endl;
system("PAUSE");
return(0);
}