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 (

ID: 3583318 • 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 in parallel to store the 10 employee identification numbers and gross pay amounts. Assume the employee identification numbers and gross pay amounts have already been entered into the above two arrays. Write a loop (not the complete program) that uses these two arrays to output each employee's identification number and weekly pay.

Explanation / Answer

1)Array to store employee id is empid[10] and to store employee's pay is emppay[10].

C++ statements:

int  empid[10];

double emppay[10];

2)

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

{

cout<<"Employee id is "<<empid[i]<<endl;

cout<<"Employee's Wekly Pay is "<<emppay[i]<<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