Hey, can anyone help me figure out why I keep getting a "linker error" when running this program?
the error is- [Linker error] undefined reference to `billingamount(double, double, bool)'
Code:
#include <iostream>
#include <iomanip>
using namespace std;
double billingamount(double hourlyrate, double contime, bool incomestatus);
int main()
{
double income;
double hourlyrate;
double contime;
bool incomestatus;
cout <<"Enter income: ";
cin >> income;
cout << endl;
if(income<=25000)
incomestatus=1;
else
incomestatus=0;
cout << "Enter the hourly rate: ";
cin >> hourlyrate;
cout <<endl;
cout <<"Enter the total consulting time in minutes: ";
cin >> contime;
cout << endl;
cout << fixed << showpoint <<setprecision(2)<<endl;
cout <<"the billing amount is $" << billingamount(hourlyrate,contime,incomestatus) << endl;
system("pause");
return 0;
}
double billingamout(double hourlyrate, double contime, bool incomestatus)
{
double charges;
if (incomestatus)
if(contime<=30)
charges=0.0;
else
charges=hourlyrate*0.4*(contime-30)/60;
else if(contime<=20)
charges=0.0;
else
charges=hourlyrate*0.7*(contime-20)/60;
return charges;
}