/* christopher bruce
payroll class header file
*/
#include <string>
usingnamespace std;
class payroll
{
int hours;
double hourlyrate;
double grosspay;
int maxhours;
}
/*
christopher bruce
employee class header file
*/
#include <string>
usingnamespace std;
class employee
{
string firstname;
string lastname;
constchar* idnum;
string dept;
string position;
};
#include <iostream>
#include <cmath>
#include <string>
#include <fstream>
#include "employee.h";
#include "payroll.h";
usingnamespace std;
int hours;
double hourlyrate;
double grosspay;
int maxhours;
employee::employee ()
{
employee employee1;
employee employee2;
employee employee3;
employee1.firstname = "susan";
employee1.lastname = "meyers";
employee1.idnum = "47899";
employee1.dept = "accounting";
employee1.position = "vice president";
employee2.firstname = "mark";
employee2.lastname = "jones";
employee2.idnum = "39119";
employee2.dept = "it";
employee2.position = "programer";
employee3.firstname = "joy";
employee3.lastname = "rogers";
employee3.idnum = "81774";
employee3.dept = "manufacturing";
employee3.position = "engineer";
cout << employee1.firstname << " " << employee1.lastname << " id number: " << employee1.idnum << " " << employee1.dept << " " << employee1.position << endl;
cout << employee2.firstname << " " << employee2.lastname << " id number: " << employee2.idnum << " " << employee2.dept << " " << employee2.position << endl;
cout << employee3.firstname << " " << employee3.lastname << " id number: " << employee3.idnum << " " << employee3.dept << " " << employee3.position << endl;
}
void payroll ()
{
cout << "please enter the payrate:";
cin >> hourlyrate;
cout << "please enter the hours:";
cin >> hours;
if (hours > 60)
{
hours = 0;
cout << "hours must be less then 60. ";
cout << "please reenter hours:";
cin >> hours;
}
else
{
grosspay = hourlyrate * hours;
}
}
void main ()
{
cout << "here are three random employees from a random compony" << endl;
};
Error 1 error C2143: syntax error : missing ';' before 'using' c:\documents and settings\allisa\my documents\visual studio 2010\projects\classes\classes\class.cpp 7 1 classes
Error 3 error C2264: 'employee::employee' : error in function definition or declaration; function not called c:\documents and settings\allisa\my documents\visual studio 2010\projects\classes\classes\class.cpp 17 1 classes
this error times 3
Error 2 error C2600: 'employee::employee' : cannot define a compiler-generated special member function (must be declared in the class first) c:\documents and settings\allisa\my documents\visual studio 2010\projects\classes\classes\class.cpp 16 1 classes
ok i get the point, but am unsure of the correct syntax, because i thought that that is what i was doing in the main cpp file when i put in employee:employee () (line 52)