Ok, but, what is the problem? What's not working? (I'm going to test this program right now huh) The only thing I can tell you right now that can help you is this:
1 2 3 4 5
|
double calculateCharge(double x, double y)
{
// double charge; ---> this variable is not initialized. Under certain circumstances
// you may end up with an unknown return value. So initialize this to 0.0:
double charge = 0.0;
|
Also here you have a mistake on line 25:
|
...<<setw(12) "Minutes" ... // you are missing a "<<" here between setw and "Minutes".
|
Also, did you write the following things because your teachers did teach you?
I mean these:
1 2 3 4 5
|
// beginning:
#include <math.h>
// ending of main()
system("pause");
|
If your teacher teached you these two things, you are probably having a bad teacher.
in C++ you should do such things differently:
1 2 3 4 5 6 7
|
// beginning: remove "#include <math.h>" and add:
#include <cmath>
// ending of main(): remove system("pause") and add:
cout<<"\nPress a Key to Exit.";
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cin.get();
|
The first thing, about including cmath, isn't really important because of something, but, as you are on C++, you shouldn't use C headers.
math.h is C, cmath is C++.
the system() thing is a REALLY important thing. It is REALLY risky and you should NEVER, NEVER use it. It also "flags" your executable as a virus.
See here for more informations:
http://www.cplusplus.com/forum/articles/11153/