While loop with a return value function

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:

1>------ Build started: Project: Lab 11C, Configuration: Debug Win32 ------
1>Compiling...
1>Lab_11C_CalcGas.cpp
1>Linking...
1>Lab_11C_CalcGas.obj : error LNK2019: unresolved external symbol "double __cdecl CalcComm(double,double)" (?CalcComm@@YANNN@Z) referenced in function _main
1>D:\modified\Intro to Computer Science I\C++ Files\Lab 11C\Debug\Lab 11C.exe : fatal error LNK1120: 1 unresolved externals

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*************
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>
using namespace 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 


edited to remove typos (I think I got them all)
Last edited on
The function CalcComm is not defined anywhere.
Oops I figured out what was missing here; it's working now.

Thanks for the help.
Topic archived. No new replies allowed.