1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#include<iostream>
#include<iomanip>
using namepsace std;
class employeerecord
{
string employeeid;
string lastname;
string firstname;
float hours;
float payrate; // per hour
float grosspay;
};
int main()
{
employeerecords employee[maximumrecords] = {
{"De Bosse", "Ian", 34.5, 45.75, 0.05},
{ "Smithers", "Weylan K.S.", 40.1, 28.75, 0.04},
{"Simpson", "Homer J.", 40, 23.44, 0.023}
};
cout << "Display All Employees" << endl;
ptToArray = &employee[0];
for(int i = 0; i <= maximumrecords - 1; i++ )
{
cout << "Employee #" << (i + 1) << endl;
cout << ptToArray[i].lastname << ", " << ptToArray[i].firstname << endl;
cout << "Hours Worked: " << ptToArray[i].hoursworked << " $" << ptToArray[i].hoursworked << endl;
cout << "Employee Pay Rate: " << ptToArray[i].payrate << " $" << ptToArray[i].payrate << endl;
cout << "Employee Tax Rate: " << ptToArray[i].taxrate * 100 << "%" << endl;
}
}
|