|
-
March 10th, 2003, 03:32 AM
#1
Senior Member
non security c++ help
If all else is correct, libraries, variables etc., what is wrong with the following future value formula:
(payment*((1+rate)pow-1))/rate
I have a paper do tomorrow and complie as I go along and, using visual studio6, all errors point to the formula-I have fiddled with it for an hour and it's in the book-any ideas???
#include <iostream>
#include <cmath>
#include <fstream>
using namespace std;
int main()
int payment = 0;
int term = 0;
float rate = 0.0;
float value = 0.0;
/* the cins and couts are enter and every "term" has a cin excepting value which will be defined as the future value of a deposit plan compounded annually and the floats and ints are right for the info i have to enter- the error says something to the effect that the parentheses before "pow" isn't defined*/-the readers digest version
the only way to fix it is to flush it all away-tool
-
March 10th, 2003, 03:50 AM
#2
What kind of error are you getting?
What's the type of those variables?
Ammo
You can't just put pow after the parenthesis as in the mathematical format, you need to the multplicaiton symbol *...
Ammo
Credit travels up, blame travels down -- The Boss
-
March 10th, 2003, 04:14 AM
#3
As ammo said, the pow function has to be used as
pow(base, exponent)
Assuming I have the future value formula correct (I used FV = Payement*((1+rate)^numYears)
you would have
FV = payement*(pow(1+rate, numYears))
Hope this helps!
\"When you say best friends, it means friends forever\" Brand New
\"Best friends means I pulled the trigger
Best friends means you get what you deserve\" Taking Back Sunday
Visit alastairgrant.ca
-
March 10th, 2003, 04:26 AM
#4
Oh! Heh, I thought pow was also a variable!
Disregard my answer, Algaen's right!
Ammo
Credit travels up, blame travels down -- The Boss
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|