i have written the following code. the problem is when i run (F9), i dont see my output neither do i see any error in the program. any idea why? thx in advance.
empId: an array of seven long integers to hold employee identification numbers.
hours: an array of seven integers to hold the number of hours worked
by each employee
payRate: an array of seven floats to hold each employee's hourly pay rate
wages: an array of seven floats to hold each employee's gross wages.
The program should relate the data in each array through the subscripts. For
example, the number in element 0 of the 'hours' array should be the number of
hours worked by the employee whose identification number is stored in element 0
of the 'empId' array. That same employee's pay rate should be stored in element
0 of the payRate array.
The program should display each employee number and ask the user to enter that
employee's hours and pay rate. It should then calculate the gross wages for that
employee (hours times pay rate), which should be stored in the 'wages' array.
After the data has been entered for all the employees, the program should
display each employee's identification number and gross wages.
#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
int main(int argc, char *argv[])
{
const int size = 7;
long empID[size] = {5658845, 4520125, 7895122,
8777541, 8451277, 7302850, 7580489};
int hours[size];
float payRate[size];
float wages[size];
//Function Prototypes
float getWages(float);
float displayWages(float);
cout<<"Enter the info for each of the following employees "<<endl;
cout<<"identified by their ID numbers: "<<endl;
getWages(1);
displayWages(1);
//_________________________________________________________________________________________
//Input hours worked
float getWages(float size, int hours, float payRate, float empID);
{
for (int index = 0; index < size; index++)
{
cout<<" "<<endl;
cout<<"Employee number: "<<empID[index]<<endl;
cout<<"Number of hours worked: ";
cin>>hours[index];
//eliminate negative numbers
while (hours[index] < 0)
{
cout<<"Employee can not work negative hours"<<endl;
cout<<"Number of hours worked: ";
cin>>hours[index];
}
cout<<"Pay Rate: ";
cin>>payRate[index];
}
}
//____________________________________________________________________________
//Display the hours worked and the employees number
float displayWages(float wages, float size, int hours, float Payrate, float empID);
cout<<"\n\n"<<endl;
cout<<"Employee Number Wages "<<endl;
cout<<"__________________________________"<<endl;
cout<< fixed << showpoint << setprecision(2);
for (int index = 0; index <size; index++)
{
double wages = hours[index] * payRate[index];
cout<<" "<<empID[index]<<" $ "<<wages<<endl;
}
cin.ignore(-1u); // clears EVERYTHING out of cin
cin.clear(); // resets cin so the next line will work
cin.get(); // wait for a character to be pressed
// system("PAUSE");
// return EXIT_SUCCESS;
}