199k views
5 votes
In a program you need to store identification numbers of 5 employees and their weekly gross pay.

a. Define two arrays that may be used in parallel to store the 5 employee identification numbers and weekly gross pay amounts.
b. Write a loop that uses these arrays to print each of the employees identification number and weekly gross pay.

User Jayphelps
by
5.1k points

1 Answer

4 votes

Solution :

a). The two arrays that are used in parallel in order to store the identification of two numbers of 5 employees and their weekly gross payments is :

int id_array[5];

double gross_pay[5];

b). The loop that uses the arrays for printing the identification number and the weekly gross payment is given below :

for(int i=0; i<5; i++)

{

count <<id_array[i] <<" " << gross_pay[i] << end;

}

User Ilya Lysenko
by
5.6k points