Issue with funtions

I am pretty new to programming. For one of my classes i have to write a program using functions. So far this is what i have. I left out the functions that are working so far but every time i compile it i get this error
1>GeometricShapes.obj : error LNK2001: unresolved external symbol "double __cdecl clac(double,double,double,char)" (?clac@@YANNNND@Z)
1>c:\users\per\documents\visual studio 2010\Projects\GeometricShapes\Debug\GeometricShapes.exe : fatal error LNK1120: 1 unresolved externals
// GeometricShapes.cpp : Defines the entry point for the console application.
//
i have left the call to the calc() function out and it runs fine. Can anyone help me out?

#include "stdafx.h"
#include <iostream>
using namespace std;

void Overview();
double UserInput(char, double&, double&, double&);
void PrintOut(double, char);
void ProgramEnd();
double clac(double, double, double, char);


int main()
{

char moreData, shapeSelection;
double Length, Width, Radius, Area = 0.0;

Overview();
do
{
cout << " -- VALID SHAPES --\n"
<< "Enter S for square\n"
<< "Enter C for circle\n"
<< "Enter R for rectangle\n";
cout << "Enter your selection: ";
cin >> shapeSelection;

while (shapeSelection != 'S' && shapeSelection != 's' && shapeSelection != 'C' && shapeSelection != 'c' && shapeSelection != 'R' && shapeSelection != 'r')
{
cout << "\n\n -- VALID SHAPES --\n"
<< "Enter S for square\n"
<< "Enter C for circle\n"
<< "Enter R for rectangle\n";
cout << "<" << shapeSelection << ">" << " is not a valid selection. Please re-enter: ";
cin >> shapeSelection;
}

UserInput(shapeSelection, Length, Width, Radius);
Area = clac(Length, Width, Radius, shapeSelection);
PrintOut(Area, shapeSelection);

cout << "Do you want to enter more data? Y/N ";
cin >> moreData;
}
while (moreData == 'Y' || moreData == 'y');

ProgramEnd();

system("pause");
return 0;

}


double UserInput(char shape, double& length, double& width, double& radius)
{
if (shape == 'S' || shape == 's')
{
cout << "Enter the length of one side of the square: ";
cin >> length;
}
if (shape == 'C' || shape == 'c')
{
cout << "Enter the radius of the circle: ";
cin >> radius;
}
if (shape == 'R' || shape == 'r')
{
cout << "Enter the lenght of the rectangle: ";
cin >> length;
cout << "Enter the width of the rectangle: ";
cin >> width;
}

return 0;
}

double calc( double length, double width, double radius, char shapeSelection)
{
double area = 0.0;
double PI = 3.14159;

if (shapeSelection == 'S' || shapeSelection == 's')
area = length * length;
if (shapeSelection == 'C' || shapeSelection == 'c')
area = PI * radius * radius;
if (shapeSelection == 'R' || shapeSelection == 'r')
area = length * width;

return area;
}

You mistyped your function "calc" in several places. Make them consistent.
Wow. I can't believe that. It was very late at night but wow. Thank you
Topic archived. No new replies allowed.