Question

in C++ Write a program which uses the following arrays: empID: An array of 7 integers...

in C++ Write a program which uses the following arrays:

  1. empID: An array of 7 integers to hold employee identification numbers. The array should be initialized with the following values: 1, 2, 3, 4, 5, 6, 7.
  2. Hours: an array of seven integers to hold the number of hours worked by each employee.
  3. payRate: an array of seven doubles to hold each employee’s hourly pay rate.
  4. Wages: an array of seven doubles to hold each employee’s gross salary.
  5. The program should display each employee number and ask the user to enter that employee’s hours and pay rate. It should then calculate the gross wages for that employee (hours times pay rate) and store them in the wages array. After the data has been entered for all the employees, the program should display each employee’s identification number and gross wages.
0 0
Add a comment Improve this question Transcribed image text
Answer #1


#include <iostream>

using namespace std;

int main()
{
int empID[]={ 1, 2, 3, 4, 5, 6, 7};
int hours[7];
double payRate[7];
double wages[7];
for(int i=0;i<7;i++){
   cout<<"Enter hours for "<<empID[i]<<": ";
   cin>>hours[i];
   cout<<"Enter pay Rate for "<<empID[i]<<": ";
   cin>>payRate[i];
   wages[i]=payRate[i] * hours[i];
  
}
cout<<"Emp No\t Hours\tPayRate\tWages\n";
  
for(int i=0;i<7;i++){
       cout<<empID[i]<<"\t "<<hours[i]<<"\t "<<payRate[i]<<"\t "<<wages[i]<<"\n";
      
}
  


return 0;
}

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
in C++ Write a program which uses the following arrays: empID: An array of 7 integers...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • EmpId: An array of seven Integers to hold employee identification numbers. The array should be in...

    C# please... Design a program that uses the following parallel arrays: empId: An array of seven Integers to hold employee identification numbers. The array should be initialized with the following numbers: 56588 45201 78951 87775 84512 13028 75804 hours: An array of seven Integers to hold the number of hours worked by each employee payRate: An array of seven Reals to hold each employee's hourly pay rate wages: An array of seven Reals to hold each employee's gross wages. The...

  • I hope some one can help me with the Python excercise (coding) Design a program that...

    I hope some one can help me with the Python excercise (coding) Design a program that uses the following parallel arrays: ● empId: An array of seven Integers to hold employee identification numbers. The array should be initialized with the following numbers: 56588 45201 78951 87775 84512 13028 75804 ● hours: An array of seven Integers to hold the number of hours worked by each employee. ● payRate: An array of seven Reals to hold each employee’s hourly pay rate....

  • Program is to be written In C++, The output should look like the screen shot. It...

    Program is to be written In C++, The output should look like the screen shot. It should allow the user to continue to ask the user to enter all employee ID's until done and then prompt the user to enter the hours and pay rate for each employee ID. Please help:( Can you please run the program to make sure the output is just like the screenshot please? It needs to have the output that is in the screenshot provided,...

  • C++ Linked Lists You have been hired by Employees. Inc to write an employee management system....

    C++ Linked Lists You have been hired by Employees. Inc to write an employee management system. The following are your specifications: Write a program that uses the following linked lists: bullet empId: a linked list of seven long integers to hold employee identification numbers. The array should be initialized with the following numbers: 5658845 4520125 7895122 8777541 8451277 1302850 7580489 bullet hours: a linked list of seven integers to hold the number of hours worked by each employee bullet payRate:...

  • You are to write a program that will process employees and their pay. For each employee...

    You are to write a program that will process employees and their pay. For each employee the program will read in an employee’s name and hourly pay rate. It should also read in the number of hours worked each day for 5 days and calculate his or her total number of hours worked. You must read the hours using a loop. The program should output the employee’s name, gross pay, total withholding amount and net pay. Withholding is made up...

  • Write a program which takes 2 arrays of 10 integers each, a and b. c is...

    Write a program which takes 2 arrays of 10 integers each, a and b. c is another array with 20 integers. The program should put into c the appending of b to a, the first 10 integers of c from array a, the latter 10 from b. Then the program should display the array c, then find and display the Minimum value of the array c.

  • C coding language is used. Write a program that declare parallel arrays for storing information about...

    C coding language is used. Write a program that declare parallel arrays for storing information about 10 employees. One array will store the hours each person worked for a week and a second array will store each person's weekly pay. Your program should ask the user for the number of hours each of the 10 employees worked. The pay should calculate both regular and overtime pay. Assume that all 10 employees earn $15.25 per hour. Your program should allow the...

  • Write a Program in C language for: 1. Create a C program to read 7 integers...

    Write a Program in C language for: 1. Create a C program to read 7 integers and store them in an array. Next, the program is to check if the array is symmetric, that is if the first element is equal to the last one, the value of the second one is equal to the value of the last but one, and so on. Since the middle element is not compared with another element, this would not affect the symmetry...

  • C++ Program The Ward Bus Manufacturing Company has recently hired you to help them convert their...

    C++ Program The Ward Bus Manufacturing Company has recently hired you to help them convert their manual payroll system to a computer-based system. Write a program to produce a 1-week payroll report for only one employee to serve as a prototype (model) for the administration to review. Input for the system will be the employee’s 4-digit ID number, the employee’s name, hours worked that week, and the employee’s hourly pay rate. Output should consist of the employee’s ID number, the...

  • C programming Strictly - Write a program to sort an array of integers via arrays of...

    C programming Strictly - Write a program to sort an array of integers via arrays of pointers to those integers as shown in the figure. Problem 1 (68 points): Write a program to sort an array of integers via arrays of pointers to those integers as shown in the figure. The code should contain the following functions: 1)to randomly generate an array of integer numbers; 2) to allocate memory and build the arrays of pointers as shown in the figure...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT