missing function header

Reply

Join Date: Mar 2004
Posts: 12
Reputation: popo_prince is an unknown quantity at this point 
Solved Threads: 0
popo_prince popo_prince is offline Offline
Newbie Poster

missing function header

 
0
  #1
May 8th, 2004
i can't get this to run. my math functions at the end have messed up logic.
and the superfluous function headers and such. i don't think the math output is linked to the desired output of the payment.


  1.  
  2. #include <iostream.h>
  3. #include <math.h>
  4. #include <cstdlib>
  5. #include <iomanip> //here i am just throwing stuff in to try and fix the "missing function header"
  6. int main( )
  7. {
  8.  
  9. double months, amount, rate;
  10. double MonthlyPayment (double amount, double rate, int months);
  11. int GetChoice(void);
  12. int option;
  13. option = GetChoice();
  14.  
  15. {
  16. cout << "Enter the loan amount: ";
  17. cin >> amount;
  18. cout << "Enter the interest rate (X.Y): ";
  19. cin >> rate;
  20. cout << "Enter the length of the loan in months : ";
  21. cin >> months;
  22. cout << "\tYour monthly payment is $ ";
  23. option = GetChoice();
  24. }
  25. return 0;
  26. }
  27. int GetChoice(void)
  28. {
  29. int num;
  30. cout << endl;
  31. cout << "1. Calculate your monthly payment on the loan."
  32. << endl << "You will enter the loan amount, Interest rate, and Length of the loan" << endl;
  33. cout << "0. Exit the program" << endl;
  34. cout << "Press 1 to procede : ";
  35. cin >> num;
  36. return num;
  37. }
  38.  
  39. {
  40.  
  41. int (amount * months) / rate = MonthlyPayment;
  42. return MonthlyPayment;
  43. }
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 141
Reputation: meabed is on a distinguished road 
Solved Threads: 2
Team Colleague
meabed's Avatar
meabed meabed is offline Offline
Junior Poster

Re: missing function header

 
0
  #2
May 8th, 2004
I Don't know what the program about .. and what the last function about ?
maybe u must define the fuction to make it work . then you must declare the variables inside it .coz those variables are declared as local variable in main()..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC