fuctions and passing arrays by value

This payroll program I have works perfectly, but I need to add in the input validation for not accepting negative values for hours worked and numbers less than 6.00 for pay rate. Also another big problem I have is that the teacher put a twist to the assignment she said we needed to be sure to USE 2 FUNCTIONS THAT PASS THE ARRAYS BY VALUE. Ive tried looking at examples in the book and even practicing on other codes but I just cant seem to grasp the concetpt.

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

int main()
{
int count,
empId[7] = {565, 452, 789, 877, 845, 130, 758};
double payRate;
double hoursWorked;
double wagesEarned[7];

for(count = 0;count <= 6; count++)
{
cout << "Employee number : " << empId[count] << endl;

cout << "\nEnter employee's hour : ";
cin >> hoursWorked;


cout << "Enter employee's pay rate : ";
cin >> payRate;

wagesEarned[count] = hoursWorked * payRate;
cout << "\n";
}




for(count = 0;count <= 6;count++)
{
cout << "Employee number : " << empId[count] << endl;
cout << "Employee gross wager : " << fixed << setprecision(2) << wagesEarned[count] << endl;
cout << "\n";
}


system("pause");
return 0;
}

>
Topic archived. No new replies allowed.