Home Forums C Programming Help Please Re: Re: Help Please

#3602
GWILouisaxwzkla
Participant

could try:


/****************************************************************
* File Name : c:programstempCG.cpp
* Date : August,11,2009
* Comments : new project
* Compiler/Assembler : Visual C++ 6.0
* Modifications :
*
*
*
*
*
* Program Shell Generated At: 2:00:25 p.m.
=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/


#include
//#include
//#include
//#include
//#include
//#include

using namespace std;

//main function ******************************

int main ( )
{

int numberYears;
float interestRate;
int initialAmount;

cout << "enter intial amount: ";
cin >> initialAmount;

cout << "enter the interest rate: ( rate % ) " ;
cin >> interestRate;
interestRate = interestRate / 100;
cin.get ();

cout << "enter number of years: ";
cin >> numberYears;

cout << "amount plus interest: ";
cout << initialAmount + ( ( interestRate * initialAmount ) * numberYears ) ;
cout << endl;



return 0 ;
}




output:


enter intial amount: 100
enter the interest rate: ( rate % ) 10%
enter number of years: 2
amount plus interest: 120
Press any key to continue