Apr 3, 2008 at 9:20pm Apr 3, 2008 at 9:20pm UTC
The function protoype dose not match the function definition:
1 2 3 4 5 6 7 8 9 10 11
//function prototypes
double getMiles();
double getNumGallons();
double calcMpg();
...
//Does not match prototype!
double calcMpg(double mil, double gal)
{
return mil/gal;
}
Change your function prototype as:
1 2 3 4 5 6 7 8 9 10 11
//function prototypes
double getMiles();
double getNumGallons();
double calcMpg(double mil, double gal);
...
//Does match prototype!
double calcMpg(double mil, double gal)
{
return mil/gal;
}
call the function as:
1 2 3 4 5 6
//enter input items
miles = getMiles();
gallons = getNumGallons();
//calculate miles per gallon
milesPerGal = calcMpg(miles, gallons);
or
milesPerGal = calcMpg( getMiles(), getNumGallons() );
Last edited on Apr 3, 2008 at 9:25pm Apr 3, 2008 at 9:25pm UTC
Apr 3, 2008 at 10:19pm Apr 3, 2008 at 10:19pm UTC
Thank you so VERY much!
You have absolutely no idea what I went thru today trying to figure it out!
darn that was really quite easy!!!!
Thanks again!!!