write the program in C++ Assume eight employees working at Ziomind Sdn Bhd (Ismail, Atikah, Ravi, Sumaia, Jonathan, Halimah, Salleh, and Khadijah). The working hours are flexible and every employee might work as low as 1 hour or as much as 9 hours per day for 7 days per week. The company would like to prepare a report that displays the number of working hours for each employee per day, the total working hours per week, and the highest working hours in the week achieved by each employee. Write a program that reads the data recorded by the eight employees that contain the following: A one-dimensional array to store the names of the eight employees and a two-dimensional array of eight rows and seven columns of type double to store the seven-day work hours for each employee. A function named read_data() to read data from the user and display the employee’s names and the seven-day work hours. The employee’s name should be stored in the one-dimensional array of type string. A function to calculate and display the total working hours for each employee per week and the highest working hours in the week by each employee. The data is given to you as shown below. The data is read in sequence as follows; the first input is the name of the employee, the subsequent input represents the working hours' values each day per week. Sample input (asking user to put input value): Ismail 2 4 3 4 5 8 8 Atikah 7 3 4 3 3 4 4 Ravi 3 3 4 3 3 2 2 Sumaia 9 3 4 7 3 4 1 Jonathan 3 5 4 3 6 3 8 Halimah 3 4 4 6 3 4 4 Salleh 3 7 4 8 3 8 4 Khadijah 6 3 5 9 2 7 9 Sample output: Name Sun Mon Tue Wed Th Fri Sat ---------------------------------------------------------------------------- Ismail 2 4 3 4 5 8 8 Atikah 7 3 4 3 3 4 4 Ravi 3 3 4 3 3 2 2 Sumaia 9 3 4 7 3 4 1 Jonathan 3 5 4 3 6 3 8 Halimah 3 4 4 6 3 4 4 Salleh 3 7 4 8 3 8 4 Khadijah 6 3 5 9 2 7 9 Name Total hours Highest Working Hours ------------------------------------------------------------------------ Ismail 34 8 Atikah 28 7 Ravi 62 4 Sumaia 31 9 Jonathan 32 8 Halimah 63 6 Salleh 37 8 Khadijah 41 9
write the program in C++
Assume eight employees working at Ziomind Sdn Bhd (Ismail, Atikah, Ravi, Sumaia, Jonathan, Halimah, Salleh, and Khadijah). The working hours are flexible and every employee might work as low as 1 hour or as much as 9 hours per day for 7 days per week.
The company would like to prepare a report that displays the number of working hours for each employee per day, the total working hours per week, and the highest working hours in the week achieved by each employee.
Write a program that reads the data recorded by the eight employees that contain the following:
- A one-dimensional array to store the names of the eight employees and a two-dimensional array of eight rows and seven columns of type double to store the seven-day work hours for each employee.
- A function named read_data() to read data from the user and display the employee’s names and the seven-day work hours. The employee’s name should be stored in the one-dimensional array of type string.
- A function to calculate and display the total working hours for each employee per week and the highest working hours in the week by each employee.
The data is given to you as shown below. The data is read in sequence as follows; the first input is the name of the employee, the subsequent input represents the working hours' values each day per week.
Sample input (asking user to put input value):
Ismail 2 4 3 4 5 8 8
Atikah 7 3 4 3 3 4 4
Ravi 3 3 4 3 3 2 2
Sumaia 9 3 4 7 3 4 1
Jonathan 3 5 4 3 6 3 8
Halimah 3 4 4 6 3 4 4
Salleh 3 7 4 8 3 8 4
Khadijah 6 3 5 9 2 7 9
Sample output:
Name |
Sun |
Mon |
Tue |
Wed |
Th |
Fri |
Sat |
---------------------------------------------------------------------------- |
|||||||
Ismail |
2 |
4 |
3 |
4 |
5 |
8 |
8 |
Atikah |
7 |
3 |
4 |
3 |
3 |
4 |
4 |
Ravi |
3 |
3 |
4 |
3 |
3 |
2 |
2 |
Sumaia |
9 |
3 |
4 |
7 |
3 |
4 |
1 |
Jonathan |
3 |
5 |
4 |
3 |
6 |
3 |
8 |
Halimah |
3 |
4 |
4 |
6 |
3 |
4 |
4 |
Salleh |
3 |
7 |
4 |
8 |
3 |
8 |
4 |
Khadijah |
6 |
3 |
5 |
9 |
2 |
7 |
9
|
Name |
Total hours |
Highest Working Hours |
|
||||
------------------------------------------------------------------------ |
|
||||||
Ismail |
34 |
8 |
|
||||
Atikah |
28 |
7 |
|
||||
Ravi |
62 |
4 |
|
||||
Sumaia |
31 |
9 |
|
||||
Jonathan |
32 |
8 |
|
||||
Halimah |
63 |
6 |
|
||||
Salleh |
37 |
8 |
|
||||
Khadijah |
41 |
9 |
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 6 images