Need help with arrays!!!

I am trying to store values from the user into an array and then display them it seems really simple and I do not know why it is not working. I can store the values fine but when I try to display them the first two values show garbage numbers.When looking at the code the first loop iterates fine but the second loop doesnt. Please help. Here is my code.

#include <iostream>
#include <iomanip>

using namespace std;

int main ()
{
const int NUM_EMPLOYEES=7;
const long empId[NUM_EMPLOYEES]={5658845,4520125,7895122,8777541,8451277,1302850,7580489};
double hours[6],
payRate[6],
wages[6];

cout<<fixed<<showpoint<<setprecision(2);
for(int count=0;count<NUM_EMPLOYEES;count++)
{
cout<<"Employee ID: "<<empId[count]<<endl;
cout<<"Enter the amount of hours worked and the pay rate"<<endl;
cout<<"hours: ";
cin>>hours[count];
cout<<"Pay Rate: $";
cin>>payRate[count];
wages[count]=hours[count]*payRate[count];
cout<<wages[count]<<endl;
}



for(int count=0;count<NUM_EMPLOYEES;count++)
{
cout<<"Employee ID: "<<empId[count]<<endl;
cout<<"Wages: $"<<wages[count]<<endl;
}

return 0;
}


Topic archived. No new replies allowed.