-
October 21st, 2012, 07:03 AM
#1
c++ employee class
i would appreciate if someone can check out for me why l can't build this code, l have tried everything possible, have been on it for 2wks though lm new in c++ class. can not even say this is the error as it is giving me 45 errors. l am writing code which accept employee type based on calculating the miles travelled in a year,my code is based on type of employee, number of vacation days used and no of sick days used.
#include <iostream>
#include <iomanip>
#include <conio.h>
class employee {
int emp_type;
float emp_vacation;
public
void assign; (int e, float ec);{ empl_type; empl_vacations }=e;
void disp () const { cout <<endl<< setw(20)<<empl_type<< setw(15)<<empl_vacation;}
};
void main (void)
cout << employeetype ;<<;
cout<<vacationdaysused ;<<;
cout <<sickdaysused ;<<;
employee x [2]; int a; float b;
for(int i=0; i<2
cout<< Enter employee"<<++i<<" type;" cin>>a; << \n"
cout << Enter employee "<<i<<" vacationdaysused;" cin>>b;<< \n"
cout << Enter employee "<<i<<"sickdaysused;"<<; \n"
x[i+1]. assign (a,b);
cout <<setw (1) << "employeevacationdaysused"<<setw(2)<<" employeesickdaysused;"
for (int j)=0; j<2>; j++) { x [j].disp ();
return 0;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|