classes

#include <iostream>
#include <iomanip>
using namespace std;


int main ()
{
const int numOfEmployees = 7;
int empId[numOfEmployees]= {5658845,4520125,7895122,8777541,8451277…
int hours[numOfEmployees];
double payRate[numOfEmployees];
double wages[numOfEmployees];


cout << "Enter the hours worked by 7 employees and their hourly pay rates.\n";
cout << endl;
for (int count = 0;count < numOfEmployees;count++)
{
cout << endl;
cout << "Hours worked by employee #"<<empId[count]<< ":";
cin >> hours[count];
while (hours < 0)
{
cout <<"Please enter a positive number: ";
cin >> hours[count];
}
cout << "Hourly pay rate for employee #"<<empId[count]<<":";
cin >> payRate[count];
while (payRate[count] < 6.00)
{
cout << "Please enter a pay rate higher than $6.00: ";
cin >> payRate[count];
}
}

for (int count = 0;count < numOfEmployees;count++)
{
wages[count]= hours[count] * payRate[count];

cout <<"Here is the gross pay for each employee:\n";
cout << fixed << showpoint << setprecision(2);
cout << "Employee #" << empId[count] << ": $" << wages[count] << endl;

}
system("pause");
return 0;
}


The main thing I need help with is writing the header file for this program in the payroll class
You mean write the payroll class in the header file for the program.

Where is this class you speak of? Or is writing the class itself what you need help with?
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
http://v2.cplusplus.com/articles/jEywvCM9/
It makes it easier to read your code and it also makes it easier to respond to your post.

yes writing the class itself is what im having trouble with
Maybe this will help you get started:
1
2
3
4
5
6
7
8
9
10
11
12
13
class Employee
{  int empid;
    int hours;
    double payRate;
    double wages;

    Employee ();
    Employee (int empid);
    void prompt_for_hours();
    void prompt_for_rate();
    void calculate_wages ();
    void print_gross_pay ();
};

Topic archived. No new replies allowed.