Zane Posted October 17, 2001 Posted October 17, 2001 No more programing labs!!! I hate thinking so much... ;) /T7AppE02.cpp - displays employee's name, FWT, FICA tax, and net pay//Zane Merva//IS121//Lab 7, ex 2//10-17-01#include <iostream>#include <string>using namespace std;//function prototypesvoid getInput(string &,float &);void calcFedTaxes(float,float,float,float &,float &);void calcNetPay(float,float,float,float &);void displayInfo(string,float,float,float)int main(){ const float FWT_RATE = float(.2);const float FICA_RATE = float(.08);string name = "";float salary = 0.0;float fwtTax = 0.0; float ficaTax = 0.0;float netPay = 0.0;//enter input items//calculate taxes//calculate net pay//display name, gross, taxes, and netreturn 0;} //end of main function//*****program-defined functions*****void getInput(string &name,float &salary){cout << "Please Enter your name";cin >> name;cout << " Please enter your weekly salary";} //end of getInput Functionvoid CalcFedTaxes(float salary,float FET_Rate,float fwtTax,float
chevy4x4trucks Posted October 17, 2001 Posted October 17, 2001 uh-huh, i see the problem, that's nonsensical babble. Speak english man.
Zane Posted October 17, 2001 Posted October 17, 2001 Update--here we go //T7AppE02.cpp - displays employee's name, FWT, FICA tax, and net pay//Zane Merva//IS121//Lab 7, ex 2//10-17-01#include <iostream>#include <string>using namespace std;//function prototypesvoid getInput(string &,float &);void calcFedTaxes(float,float,float,float &,float &);void calcNetPay(float,float,float,float &);void displayInfo(string,float,float,float)int main(){ const float FWT_RATE = float(.2);const float FICA_RATE = float(.08);string name = "";float salary = 0.0;float fwtTax = 0.0; float ficaTax = 0.0;float netPay = 0.0;//enter input items//calculate taxes//calculate net pay//display name, gross, taxes, and netreturn 0;} //end of main function//*****program-defined functions*****void getInput(string &name,float &salary){cout << "Please Enter your name";cin >> name;cout << " Please enter your weekly salary";} //end of getInput Functionvoid calcFedTaxes(float salary,float FWT_RATE,float FICA_RATE,float &fwtTax,float &ficaTax){fwtTax= FWT_RATE * salary;ficaTax= FICA_RATE * salary;} //end of CalcFedTaxes Functionvoid calcNetPay(float salary, float fwtTax,float ficaTax,float &netPay){netpay= salary - fwtTax - ficaTax;} //end of calcNetPayvoid displayInfo(string &name,float &fwtTax,float &ficaTax,float &netPay){cout
MountaineerTom Posted October 17, 2001 Author Posted October 17, 2001 Shoot me for trying to read it.
chevy4x4trucks Posted October 17, 2001 Posted October 17, 2001 yeah so what's the deal here, are you going to do all of the forum member's taxes???
Zane Posted October 17, 2001 Posted October 17, 2001 Right before i try to run it... //T7AppE02.cpp - displays employee's name, FWT, FICA tax, and net pay//Zane Merva//IS121//Lab 7, ex 2//10-17-01#include <iostream>#include <string>using namespace std;//function prototypesvoid getInput(string &,float &);void calcFedTaxes(float,float,float,float &,float &);void calcNetPay(float,float,float,float &);void displayInfo(string,float,float,float)int main(){ const float FWT_RATE = float(.2);const float FICA_RATE = float(.08);string name = "";float salary = 0.0;float fwtTax = 0.0; float ficaTax = 0.0;float netPay = 0.0;//enter input itemsgetInput(name,salary);//calculate taxescalcFedTaxes(salary,FWT_RATE,FICA_RATE,fwtTax,ficaTax);//calculate net paycalcNetPay(salary,fwtTax,ficaTax,netPay);//display name, gross, taxes, and netdisplayInfo(name,fwtTax,ficaTax,netPay);cout << "The Program Has Terminated Normally"; // <- For TroubleShootingreturn 0;} //end of main function//*****program-defined functions*****void getInput(string &name,float &salary){cout << "Please Enter your name";cin >> name;cout << " Please enter your weekly salary";} //end of getInput Functionvoid calcFedTaxes(float salary,float FWT_RATE,float FICA_RATE,float &fwtTax,float &ficaTax){fwtTax= FWT_RATE * salary;ficaTax= FICA_RATE * salary;} //end of CalcFedTaxes Functionvoid calcNetPay(float salary, float fwtTax,float ficaTax,float &netPay){netpay= salary - fwtTax - ficaTax;} //end of calcNetPayvoid displayInfo(string &name,float &fwtTax,float &ficaTax,float &netPay){cout << name << ": You have paied;"<< endl;cout << "FWT Tax Paied= $" << fwtTax << endl;cout << "FICA Tax Paied= $" << ficaTax << endl;cout << "That Makes your NET salary= $" << netPay <<endl;} //end of displayInfo Function
Zane Posted October 17, 2001 Posted October 17, 2001 awhhh, crapp...... --------------------Configuration: T7appe02 - Win32 Debug--------------------Compiling...T7appe02.cppLinking...T7appe02.obj : error LNK2001: unresolved external symbol "void __cdecl displayInfo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,float,float,float)" (?displayInfo@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MMM@Z)Debug/T7appe02.exe : fatal error LNK1120: 1 unresolved externalsError executing link.exe.T7appe02.exe - 2 error(s), 0 warning(s)
Jpshostr Posted October 17, 2001 Posted October 17, 2001 I kind of remember all that crap. Made me want to throw my computer out the window everytime I had to do anything with it. Did I ever mention how much I hate computers? I don't know how the hell some people can major in computer programming when all you do is that BS.
scottm Posted October 17, 2001 Posted October 17, 2001 Your prototype for DisplayInfo is missing the semi-colon on the end. void displayInfo(string,float,float,float) <-----------
Zane Posted October 17, 2001 Posted October 17, 2001 Quote from scottm, posted on Oct. 17 2001,2:06 Your prototype for DisplayInfo is missing the semi-colon on the end. void displayInfo(string,float,float,float) <----------- sweet! Still getting the same error though.
Kansas Kid Posted October 17, 2001 Posted October 17, 2001 Why are you asking us to help you debug that program? All you have to do is right click on the error, and click on go to error. Beats the heck out of reading through the entire thing trying to find where you are missing a semi-colon. Besides, that kind of junk shouldn't be allowed on this forum. I like to forget about C++ when I leave school. LOL
Zane Posted October 17, 2001 Posted October 17, 2001 Alright!!! It works!! #include <iostream>#include <string>using namespace std;//function prototypesvoid getInput(string &,float &);void calcFedTaxes(float,float,float,float &,float &);void calcNetPay(float,float,float,float &);void displayInfo(string,float,float,float);int main(){ const float FWT_RATE = float(.2);const float FICA_RATE = float(.08);string name = "";float salary = 0.0;float fwtTax = 0.0; float ficaTax = 0.0;float netPay = 0.0;//enter input itemsgetInput(name,salary);//calculate taxescalcFedTaxes(salary,FWT_RATE,FICA_RATE,fwtTax,ficaTax);//calculate net paycalcNetPay(salary,fwtTax,ficaTax,netPay);//display name, gross, taxes, and netdisplayInfo(name,fwtTax,ficaTax,netPay);cout << "The Program Has Terminated Normally"<< endl; // <- For TroubleShootingreturn 0;} //end of main function//*****program-defined functions*****void getInput(string &name,float &salary){cout << "Please Enter your Name: ";getline(cin, name);cout << " Please enter your weekly salary";cin >> salary;cout << endl;} //end of getInput Functionvoid calcFedTaxes(float salary,float FWT_RATE,float FICA_RATE,float &fwtTax,float &ficaTax){fwtTax= FWT_RATE * salary;ficaTax= FICA_RATE * salary;} //end of CalcFedTaxes Functionvoid calcNetPay(float salary, float fwtTax,float ficaTax,float &netPay){netPay= salary - fwtTax - ficaTax;} //end of calcNetPayvoid displayInfo(string name,float fwtTax,float ficaTax,float netPay){cout << name << ": You have payed;"<< endl;cout << "FWT Tax Paied= $" << fwtTax << endl;cout << "FICA Tax Paied= $" << ficaTax << endl;cout << "That Makes your NET salary= $" << netPay <<endl;} //end of displayInfo Function
Zane Posted October 17, 2001 Posted October 17, 2001 NEXT!!! //T7AppE04.cpp - displays a bonus//Zane Merva//IS121#include <iostream>using namespace std;//function prototypesvoid getSales(float &);void calcBonus(float,float,float &);void displayBonus(float);int main(){ const float RATE = float(.1);//declare variablesfloat sales = 0.0;float bonus = 0.0;//get input itemgetSales(sales);//calculate bonuscalcBonus(sales,RATE,bonus);//display output itemdisplayBonus(bonus);return 0;} //end of main function//*****program-defined functions*****void getSales(float &sales){cout << "Please Enter your total sales: ";cin >> sales;}void calcBonus(float sales,float RATE,float &bonus){bonus= sales * RATE;}void displayBonus(float bonus){cout << " Congrats! You earned a $" << bonus << " Bonus!" << endl;}
chevy4x4trucks Posted October 17, 2001 Posted October 17, 2001 BTW I just noticed that you changed me from a member to "Proud American..." Sweet, thanks a lot. It could have been worse, I could be the Forum Fluff Girl (which would be wrong on so many reasons)
Jpshostr Posted October 17, 2001 Posted October 17, 2001 Quote from chevy4x4trucks, posted on Oct. 17 2001,2:01 BTW I just noticed that you changed me from a member to "Proud American..." Sweet, thanks a lot. It could have been worse, I could be the Forum Fluff Girl (which would be wrong on so many reasons) Look out, you just gave him some ideas!! Remember, he has no girlfriend, so he idles away his time doing stuff like this to others.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.