ComputeAmount function

Assuming there are no deposits other than the original investment, the balance in a savings account after one year may be calculated as:
•Amount=principal*(1+rate/T)T
Principal is the balance in the savings account, rate is the interest rate, and time is the number of times the interest is compounded during a year (i.e T is 4 if the interest is compounded quarterly).Write a program that asks for the principal, the interest rate, and the number of times the interest is compounded and then generate the amount in savings.
Your program should have a function named computeAmount.

Please I have done it but how to include the ComputeAmount function in my program is the problem. Please help me gurus.
Last edited on
If you post your code AND tell us what is not working as you expect it, and how you expect to work, you most likely will get help.
Last edited on
Man I'm always doing this guy's homework.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include <cmath>
using namespace std;

double ComputeAmount(double,double,double,double&);

int main()
{
double principal;
double interestrate;
double compounded;
double savings = 0;

cout << "What is the principal?" << endl;
cin >> principal;
cout << "What is the interest rate?" << endl;
cin >> interestrate;
cout << "How many times is the interest compounded?" << endl;
cin >> compounded;

ComputeAmount(principal,interestrate,compounded, savings);

cout << "Your amount in savings is " << savings << endl;

return 0;
}

double ComputeAmount(double p, double i, double c, double& s)
{
s= p* (1+ (i/c))*c;
return s;
}

Last edited on
Tnx ma boss am new to the c++ so with time am going to be a master on my own by kind courtesy all the gurus here.
bkay, if you just have other people do your homework for you, you will not learn anything. Furthermore, you will become a crappy programmer, and when you get a real job, you'll most likely get fired when your boss realizes you can't do the work (IF you get hired at all!).

@Momothegreat
Why are you doing his homework? Don't you have somthing better to do, like the rest of the people that passed over this leech's post?
Nah I don't have anything better to do...
Topic archived. No new replies allowed.