Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In a C++ program you need to store the identification numbers of 10 employees (a

ID: 3843235 • Letter: I

Question


In a C++ program you need to store the identification numbers of 10 employees (as ints) and their weekly gross pay (as doubles). Write the statements (not the complete program) that define two arrays named id and pay that may be used to store the 10 employee identification numbers and gross pay amounts. Assume the employee identification numbers and gross pay amounts have already been stored in the above two arrays. Write a loop (not the complete program) that outputs each employee's identification number and gross pay from the two arrays.

Explanation / Answer

A) Define two arrays that may be used in parallel to store the 10 identification numbers and gross pay amounts.

const int [SIZE] = 10;
int idNumbers[SIZE];
double grossPay[SIZE];


Write a loop that uses these arrays to print each employee’s identification number and weekly gross pay.

for (int ctr = 0; ctr < SIZE; ctr++)
{
   cout << idNumbers[SIZE] << “ “ << “$” << grossPay[SIZE] << fixed << setprecision(2) << endl;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote