The void read section is where I have issues at. Please tell me what's wrong. And if there is anywhere else I need to look at. Thank you in advance.
A company hired 10 temporary workers who are paid hourly and you are given a data file that contains the last name of the employees, the number of hours each employee worked in a week, and the hourly pay rate of each employee. You are asked to write a program that computes each employee’s weekly pay and the average salary of all the workers. The program then outputs the weekly pay of each empl
constint column=3;
constint row=10;
void read(string row[], double matrix[][column])
{
// Does "row" refer to global int variable or local string array?
for(int r=0; r<row; r++)
{
// Nobody told us about any "lastname" array and neither "row" fits the bill here
row>>lastname[r];
// Not filling the last column. Why?
for (int c=0; c<column-1; c++)
{
// Who is "read" here?
read>>matrix[r][c];
}
// Magical third column override. Luckily, 2<column. This time.
matrix[r][2]=0;
}
}
Overall, reading input without checking for failure is ok only as long as the input is exactly what you expect.