### Beginning Modularization Techniques

Ok so ive pretty much done all of the work but the program still has some syntax errors that i need a little bit of help on. The program needs to reflect the pseudocode as closely as possible. On line 41 the equation for the newAmount needs to have a reference to call the finalAmount function, but everytime I place the FutureValue variable into the equation I start getting errors. If anyone has any insight it would be much appreciated. Thank You.

 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 // Start // Declarations // num amount // num newAmount // num interestRate // output "Please enter the dollar amount. " // input amount // output "Please enter the interest rate(e.g., nine percet should be entered as 9.0). " // input interestRate // newAmount = FutureValue(amount,interestRate) // output "The new dollar amount is ", newAmount // Stop // // // // num FutureValue(num initialAmount, num interestRate) // Declarations // num finalAmount // finalAmount = (1 + interestRate/100) * initialAmount // return finalAmount #include #include using namespace std; double FutureValue (); int main() { double amount; double newAmount; double interestRate; cout << "Please enter the dollar amount. " << endl; cin >> amount; cout << "Please enter the interest rate (e.g. nine percent should be entered as 9.0). " << endl; cin >> interestRate; newAmount = (amount / interestRate); cout << "The new dollar amount is " << newAmount << endl; system("PAUSE"); return EXIT_SUCCESS; } double FutureValue(double initialAmount, double interestRate) { double finalAmount; finalAmount = (1 + interestRate/100) * initialAmount; return finalAmount; }
You have forward declared the function FutureValue as
 double FutureValue ();

when it should be
 double FutureValue (double, double);
ahhh I see that now. Thank you.
Topic archived. No new replies allowed.