Join 136,094 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,608 people online right now. Registration is fast and FREE... Join Now!
double hours, rate, otime, dependents, empnum; string last,first,emptype,utype;//name of employee, city or suburb employee, union or non-union employee
while (infile>>last>>first>>emptype>>utype>>empnum>>hours>>rate>>dependents>>otime) {
string first = ""; string last = ""; last = employee.substr(0,14);
} cout<<"Emp. # First Name Last Name Hours Rate Overtime Gross Fed Tax FICA City Tax Union Dues Net Pay"<<endl; double hours = (hours * rate) + (1.5 * otime);//calculate net pay if employee works overtime
if (emptype == 'C') { double city = (gross * 0.04);//cost for working in the city } else city = 0.0; if (utype == 'M') { double uni = (gross * 0.0473);//cost for being apart of the union } else uni = 0.0; double net = ( gross - deductions);//net pay double fica = (gross * 0.0765); double ftax = ((gross - 17 * dependents) * 0.1834);//federal tax
My assignment is as follows: Write a c++ program that will read in an unknown number of employee records from a text file call PAYDATA3.TXT. Each employees record is a string of 47 characters (with spaces), set up as follows:
Positions Data Description 0 14 Last Name (15 characters) 15 -24 First name (10 characters) 25 Contains C if employee works in City office, otherwise S for Suburb 26 Contains M if employee is a union member, X if not a union member 27 31 Employee Number (5 digit characters) 32 35 Hours Worked (4 characters, in tenths) 36 40 Hourly Rate of Pay (5 characters) 41-42 Number of Dependents (2 characters) 43 46 Overtime hours worked (4 characters, in tenths, if any)
The program must perform the following tasks: A. For each employee, calculate the gross pay Gross = hours worked times hourly rate plus overtime hours time hourly rate times 1 ½ B. For each employee calculate the net pay as follows: a. net pay = gross minus deductions b. deductions are calculated as follows: Federal Tax = (gross minus 17 times no. of dependents) times 18.34% FICA = gross times 7.65% City Tax = $0.00 if employee works in the suburbs 4% of gross if employee works in the City Union Dues = $0.00 if employee is not a union member 4.73% of gross if employee is a union member
For each employee, print 1 line of information as follows: (In WORDPAD, File> Page Setup>Landcape) [Screen will show 2 lines for each employee This is OK] Emp. # First Name Last Name Hours Rate Overtime Gross Fed Tax FICA City Tax Union Dues Net Pay (All with 2 decimals)
Also compute and print (decimal points must line up vertically) 1. Number of employees processed = XX 2. Total Gross Pay = XXXX.XX 3. Total Federal Tax = XXXX.XX 4. Total FICA = XXXX.XX 5. Total Hours Worked = XXX.XX 6. Total Overtime Hours Worked = XXX.XX
Oopsss. As you can see from my infile, it has several characters for each employee: Positions Data Description 0 14 Last Name (15 characters) 15 -24 First name (10 characters) 25 Contains C if employee works in City office, otherwise S for Suburb 26 Contains M if employee is a union member, X if not a union member 27 31 Employee Number (5 digit characters) 32 35 Hours Worked (4 characters, in tenths) 36 40 Hourly Rate of Pay (5 characters) 41-42 Number of Dependents (2 characters) 43 46 Overtime hours worked (4 characters, in tenths, if any) So, how can i let it distinguish between the meanings of the different terms? Would i have to use the isalpha function? How could i access the different parts of that string to carry out the calcualtions? Thanks.
This post has been edited by zandiago: 12 Oct, 2007 - 10:12 AM
Have you considered creating an employee object? You would read the line from the text file and pass it to this employee object which would break it into the various parts (just by looping through the characters) and store it in its own member variables. Then to do all your calculations would be as simple as....
// Or better yet, wrap that work up into a "getGrossPay()" function so you could do... cout << "Total gross: " << employee->getGrossPay() << endl;
I am quite sure your instructor is going to be looking for an implementation of the employee class. Notice how they mention employee like a bajillion times.
So start by formulating an employee class and we can work on that.
any idea why i get the following error message when i try to load the Dream In Code website: Openads has not been installed yet -- please read the INSTALL.txt file
1>Compiling... 1>payroll.cpp 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\string(537) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::_Smanip<_Arg> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\iomanip(79) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::_Fillobj<_Elem> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\iomanip(46) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(930) : see declaration of 'std::operator <<' 1>c:\users\neil\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(923) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(916) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(909) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(871) : see declaration of 'std::operator <<' 1>c:\users\neil\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(825) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(785) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(738) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(700) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(653) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(53) : error C2677: binary '<<' : no global operator found which takes type 'std::string' (or there is no acceptable conversion) 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(54) : error C2296: '>>' : illegal, left operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(54) : error C2297: '>>' : illegal, right operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(55) : error C2228: left of '.clear' must have class/struct/union 1> type is 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\string(537) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::_Smanip<_Arg> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\iomanip(79) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::_Fillobj<_Elem> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\iomanip(46) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(930) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(923) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(916) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(909) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(871) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(825) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(785) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(738) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(700) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(653) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(57) : error C2677: binary '<<' : no global operator found which takes type 'std::string' (or there is no acceptable conversion) 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(58) : error C2296: '>>' : illegal, left operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(58) : error C2297: '>>' : illegal, right operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(59) : error C2228: left of '.clear' must have class/struct/union 1> type is 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\string(537) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::_Smanip<_Arg> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\iomanip(79) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::_Fillobj<_Elem> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\iomanip(46) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(930) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(923) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(916) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(909) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(871) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(825) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(785) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(738) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(700) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(653) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(61) : error C2677: binary '<<' : no global operator found which takes type 'std::string' (or there is no acceptable conversion) 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(62) : error C2296: '>>' : illegal, left operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(62) : error C2297: '>>' : illegal, right operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(63) : error C2228: left of '.clear' must have class/struct/union 1> type is 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\string(537) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::_Smanip<_Arg> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\iomanip(79) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::_Fillobj<_Elem> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\iomanip(46) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(930) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(923) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(916) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(909) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(871) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(825) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(785) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(738) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(700) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'double' 1> c:\program files\microsoft visual studio 9.0\vc\include\ostream(653) : see declaration of 'std::operator <<' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(65) : error C2677: binary '<<' : no global operator found which takes type 'std::string' (or there is no acceptable conversion) 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(66) : error C2296: '>>' : illegal, left operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(66) : error C2297: '>>' : illegal, right operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(67) : error C2228: left of '.clear' must have class/struct/union 1> type is 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(84) : error C2296: '<<' : illegal, left operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(84) : error C2297: '<<' : illegal, right operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(85) : error C2296: '>>' : illegal, left operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(85) : error C2297: '>>' : illegal, right operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(95) : error C2296: '<<' : illegal, left operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(95) : error C2297: '<<' : illegal, right operand has type 'double' 1>c:\users\neil\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(96) : error C2296: '>>' : illegal, left operand has type 'double' 1>c:\users\documents\visual studio 2008\projects\payroll\payroll\payroll.cpp(96) : error C2297: '>>' : illegal, right operand has type 'double' 1>Build log was saved at "file://c:\Users\Documents\Visual Studio 2008\Projects\payroll\payroll\Debug\BuildLog.htm" 1>payroll - 76 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I know it's crazy, a bit of syntax and i did check my '{}'s
There appear to actually only be a couple of errors, one of which is usually seen when comparing incompatible data types, and the other when using data types with specific data containers.
Can you repost your exact current code, so we can be sure what we're working with?