I couldn't understand how to do a program using two functions!! However, I must use at least two functions in this project
[Write a function that computes future investment value at a given interest rate for a specified number of years. The future investment is determined using the following formula:
Accumulative Value =
investmentAmount * (1 + MonthlyInterestRate) NumberofYears*12]
#include <iostream>
#include<math.h>
#include<iomanip>
using namespace std;
int InvesAmount, years, i, futureValue;
float annualRate,monthlyRate;
float futureV()
{
for (i=1;i<=years;i++)
futureValue=InvesAmount*pow((1+monthlyRate),(i*12));
cout<<"Years"<<setw(16)<<"Future Value\n";
cout<<i <<setw(16)<<futureValue;
}
int main()
{
cout<<"Enter your investment amount";
cin>>InvesAmount;
cout<< "How much is the interest rate?";
cin>>annualRate;
monthlyRate=(annualRate/100)/12;
cout<<"For how long you want to invest?";
cin>>years;
cout<<"Your future inestment values are ";
futureV;
}
Errors:
Control reaches end of non-function
Expression result unused
No Debug Session
[To repeat, your program should at least consist of two functions, the main function and a function that calculates the balance]
Please I want to understand how I do two functions, I didn't find good tutorials in this subject
thanks

New Topic/Question
Reply



MultiQuote






|