Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// Please follow the instructions and solve it by C++. Please and thank you. This exercise will provide practice with working with structures and arrays.Although

// Please follow the instructions and solve it by C++. Please and thank you.

This exercise will provide practice with working with structures and arrays.Although there might be many ways of doing the assignment, to get full credit, it must be done exactly as specified here(for purpose of practice)

Write a program that will record information about employees and will compute their paychecks. Each employee must be represented by a struct containing the last name, hours worked each day of the week, the hourly rate, and the pay for the week.

Hours worked each day of the week must be and array storing 5 values for the hours from Monday to Friday( The company is not open on Saturday or Sunday). This array will be inside the structure.

There will also be an array of the employees; array of structures. There must be at least four (4) employees. The array must be declared in the main function of the program. Then the entire array must be passed to a function called 'initialize'. This function will ask the user to enter values for every field of every structure, except for the pay for that week. ( the pay will be computed in a different function)

A loop for processing the array of employees must be set up in the main function. Inside the loop, a single employee will be past to the function called 'compute', which will calculate the check for that employee. If the employee worked longer than 40 hours, overpay of 1.5 times the hourly rate is to be used for each hour worked over the 40 hours. For example, an employee who worked a total of 50 hours for $10.00 an hour would make $550.00. Don't pass the entire array of employees into the 'compute'; the employees will be passed one at a time into the function, until all of their paychecks have been calculated, at which time the loop will terminate. The employee will need to be passed by reference.

A single employee must be passed into the result function, which will output the last name of the employee. Do not pass the entire array of employees to the 'result' function. Each employee must be passed through call by value, one at a time, until all of the paycheck amount have been output at which time the loop in the main function will terminate. Then the program will end.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions