I'm having a problem here, and if someone could point me in the right direction, it would be most helpful.
I've pasted the error message below, and then my code below that:
/*************
Program: Lab_11C_CalcGas.cpp
Author: Alan P. Matie
Date: 07 Apr 2009
Description: Lab 4 Fundamentals Ch4 Ex2
New Concepts:
A while loop and a return value function
Challenges:
First value functions; add a second function to determine commRate
**************/
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
usingnamespace std;
// Declare constants
// Function Prototypes
double CalcComm( double galSold, double commRate);
double detRate(double galSold);
int main()
{
// Declare variables below here
double galSold, comm, commRate;
// Initialization Section for real number output. DO NOT MOVE!
cout <<setiosflags(ios::fixed | ios::showpoint);
cout <<setprecision(2);
// Begin your "main processing" below here
cout <<"Please enter the number of gallons sold. Enter 0 to end."<<endl;
cin >>galSold;
while (galSold != 0)
{
commRate = detRate(galSold);
comm = CalcComm(galSold, commRate);
cout << "For a sale of " << galSold << " gallons the commission is $" << comm << endl;
cout << "Please enter the number of gallons sold. Enter 0 to end. ";
cin >> galSold;
}
return 0;
}
double detRate(double galSold)
{
if (galSold < 500)
{
return .03;
}
else
{
return .04;
}
}
// function definitions below here