Question
Keep getting this error in my assignment so confused Undefined symbols for architecture x86_64: output(std::__1::basic_string , double, double, double, char, int, int), referenced from:
Keep getting this error in my assignment so confused
"
Undefined symbols for architecture x86_64:
"output(std::__1::basic_string
_main in payroll.o
"getData(std::__1::basic_string
_main in payroll.o
"calcData(int, double, double, double, int, int, int, int, double, char)", referenced from:
_main in payroll.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
"
//
// payroll.cpp
// Lab 5 Payroll
//
//
/*Write a C++ program to calculate a persons pay stub assuming paid on a monthly basis.
Your design must be according to the structure chart given here. That is main() will call input function, calculation function, and output function in that order. */
#include
#include
#include
using namespace std;
void getData(string& employeename, double hourlywage,double hoursworked,int withholding,char maritalstat,double previousyearinc);
double calcData(int witholding, double hoursworked, double hourlywage, double previousyearinc, int ficatax, int currentearned, int incometax, int check,double tempnumb,char maritialstat);
void output(string employeename, double currentearned, double hoursworked,double withholding, char maritalstat, int ficatax, int check);
//output of signature
int main ()
{
string employeename;
char maritalstat = '\0';
double hoursworked = 0.0, withholding = 0.0, hourlywage = 0.0, previousyearinc = 0.0;
int ficatax = 0, currentearned = 0, incometax = 0, check = 0, tempnumb = 0;
getData(employeename, hourlywage, hoursworked, withholding, maritalstat, previousyearinc);
calcData(withholding, hoursworked, hourlywage, previousyearinc, ficatax, currentearned, incometax, check, tempnumb, maritalstat);
output(employeename, currentearned, hoursworked, withholding, maritalstat, ficatax, check);
return 0;
}
void Signature()
{
cout << "Jess Hutchins " << endl;
cout << "jess@hnhtraining.com, jesshutch@mac.com" << endl;
cout << "Lab 4"<
}
//functions prototype
double getData(string employename, double hourlywage, double hoursworked, double withholding, char maritalstat, double previousyearinc)
{
cout << "What is your name? "<
getline(cin, employename);
cout << "What is your hourly wage? "<
cin >> hourlywage;
cout << "How many hours did you work? "<
cin >> hoursworked;
cout << "What is your current with holding"<
cin >> withholding;
cout << "What is your Maritial Status (M)(S) "<
cin >> maritalstat;
cout << "What is your previous year earnings?"<
cin >> previousyearinc;
return 0;
}
//int ficatax, currentearned, incometax, check, tempnumb;
double calcData(int witholding, double& hoursworked, double hourlywage, double previousyearinc, int ficatax, int currentearned, int incometax, int check,int tempnumb,char maritialstat)
{
incometax = 0;
if(hoursworked>40)
currentearned = hourlywage*hoursworked*1.5;
else
currentearned = hourlywage*hoursworked;
if(previousyearinc<128700)
ficatax=currentearned*0.062;
else
ficatax=0;
tempnumb = currentearned - witholding*345.80;
if(maritialstat == 'S' || maritialstat == 's'){
if(tempnumb>308 && tempnumb<=1102)
incometax=tempnumb*0.1;
if(tempnumb>1102 && tempnumb<=3533)
incometax=tempnumb*0.12 + 79.40;
if(tempnumb>3533 && tempnumb<=7183)
incometax=tempnumb*0.22 + 371.12;
if(tempnumb>7183 && tempnumb<=13433)
incometax=tempnumb*0.24 + 1174.12;
if(tempnumb>13433 && tempnumb<=16975)
incometax=tempnumb*0.32 + 2674.12;
if(tempnumb>16975 && tempnumb<=41975)
incometax=tempnumb*0.35 + 3807.56;
if(tempnumb>41975)
incometax=tempnumb*0.37 + 12577.56;
}
if(maritialstat == 'M' || maritialstat == 'm'){
if(tempnumb>963 && tempnumb<=2550)
incometax=tempnumb*0.1;
if(tempnumb>2550 && tempnumb<=7413)
incometax=tempnumb*0.12 + 158.70;
if(tempnumb>7413 && tempnumb<=14713)
incometax=tempnumb*0.22 + 742.26;
if(tempnumb>14713 && tempnumb<=27213)
incometax=tempnumb*0.24 + 2348.26;
if(tempnumb>27213 && tempnumb<=34296)
incometax=tempnumb*0.32 + 5348.26;
if(tempnumb>34296 && tempnumb<=50963)
incometax=tempnumb*0.35 + 7614.82;
if(tempnumb>50963)
incometax=tempnumb*0.37 + 13448.27;
}
previousyearinc = previousyearinc+currentearned;
check = currentearned - ficatax - incometax;
return 0;
}
/*
Pre: subtotal = subtotal of order
tax = amount of tax
total = total of order
Post: Nothing
Purpose: output order
*/
/* output(currentearned, hoursworked, withholding, maritalstat, ficatax, check);*/
void output(string& employeename, double currentearned, double hoursworked,double withholding, char maritalstat, int ficatax, int check)
{
cout<<" Name:";
cout<
cout<<" Current Earnings";
cout<
cout<<" Year to Date";
cout<
cout<<" Fica:";
cout<
cout<<" Income Tax Withheld:";
cout<
cout<<" Amount of check:";
cout<
return;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started