Stuck cant seem to find the issue

Hi guys I cant figure out the issue with my code, i tried messing around with it and no such luck. I keep getting

Error 1 error LNK2019: unresolved external symbol "double __cdecl getPayRate(void)" (?getPayRate@@YANXZ) referenced in function _main

and

Error 2 fatal error LNK1120: 1 unresolved externals


here is the code********



#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

//funct prototypes
double getHoursWorked();
double getPayRate();
double calcGross(double, double);

//decl variables
double hours = 0.0;
double rate = 0.0;
double pay = 0.0;
char loopy;



int main()
{
do
{
hours = getHoursWorked();
rate = getPayRate();
pay = calcGross(hours, rate);

//***********Display information*************
cout << fixed << setprecision(2); // writes point values in scientific notation / sets the decimal point.
cout << "grossPay:$" << pay << endl;

cout << "\n\nWould you like to process another employee? ('Y' to Proceed 'N' to Stop):";
cin >> loopy;
loopy=toupper(loopy);

if (loopy!= 'Y' && loopy != 'N')
{
cout << "\n\nWould you like to process another employee? ('Y' to Proceed 'N' to Stop):";
cin >> loopy;
loopy=toupper(loopy);
cout<<endl;
}
} while(loopy == 'Y'); //end while

system("pause");
return 0;
}

//********************************************End of main***********************************************

//*********function definitions***********



//************calculates & returns gross Pay********


double calcGross(double hours,double rate)
{
double gross = 0.0;

if (hours > 40)
{
double overtime = 0.0;
overtime = hours - 40;
gross=((hours-overtime)*rate)+(overtime*(rate*1.5));
}
else
gross=hours*rate;
return gross;
}//**********endof function*********



double getHoursWorked()
{
double hoursWorked = 0.0;
cout << "Enter hours worked:";
cin >> hoursWorked;
return hoursWorked;

}
//**********endof function*********


double GetPayRate()
{
double payRate = 0.0;
cout << "Enter pay rate:";
cin >> payRate;
return payRate;
}
//**********endof function*********



Last edited on
no one knows the issue?
You declared your function as
double getPayRate();

but then your definition has
double GetPayRate().
The issue is that your prototype/declaration and your definition don't match.

double getPayRate();

double GetPayRate()
woooooow, omg im so dumb, why couldnt i see this. thanks soooo much
woooooow, omg im so dumb, why couldnt i see this. thanks soooo much


No, you are not dumb. It is easy to get used to our own code to the point we don't see our own mistakes staring us in the face. A second set of eyes can frequently find things we don't see.

As you get more experience, you will recognize error messages and better understand the hints they give you as to what to look for in your code.

Welcome to programming.
Last edited on
Topic archived. No new replies allowed.