#include<iostream>
#include<iomanip>
using namespace std;

const int SIZE = 25;

struct PayRoll
{
	int empNumber;
	char name[SIZE];
	double hours;
	double payRate;
	double grossPay;
};

int main()
{
	const int NUM_EMPLOYEE = 10;
	PayRoll employee[NUM_EMPLOYEE];
	
	for( int i=0; i<NUM_EMPLOYEE;i++)
	{
	
		cout<<"Enter the "<<(i+1)<<" employee's number : " ;
		cin>>employee[i].empNumber;
		while(employee[i].empNumber<1)
		{
			cin.clear();
			
			cin.ignore();
			cout<<"Enter the "<<(i+1)<<" employee's number : " ;
			cin >> employee[i].empNumber;
		}
	
		cout<<"Enter the employee's name: ";
		cin.ignore();
		cin.getline(employee[i].name,SIZE);
		
		cout<<"How many hours did the employee work? ";
		cin>>employee[i].hours;
	
		cout<<"What is the employee's hourly payRate? ";
		cin>>employee[i].payRate;
		cout<<endl<<endl;
		
	}
	
	
	//Display the employee data.
	cout<<"Here is the employees' payroll data:\n";
	
	for( int i=0; i<NUM_EMPLOYEE;i++)
	{	
		double grossPay;
		employee[i].grossPay = employee[i].hours * employee[i].payRate;
	
		cout<<"Employee # "<<(i+1)<<endl;
		cout<<"Name: "<<employee[i].name<<endl;
		cout<<"Number: "<<employee[i].empNumber<<endl;
		cout<<"Hours worked: "<<employee[i].hours<<endl;
		cout<<"Hourly payRate: "<<employee[i].payRate<<endl;
		cout<<fixed<<showpoint<<setprecision(2);
		cout<<"Gross Pay: $"<<employee[i].grossPay<<endl<<endl;
		
	}
	
	return 0;
}
