For this c++ write a code for Parallel Arrays First, you have to define several arrays in your main program: employee names for each employee hourly pay rate for each employee total hours worked for each employee gross pay for each employee code format: // TODO: Add function prototypes for all the declared functions // TODO: Declare two functions to compute the highestPay and lowestPay// HINT: Each should return the index of the correct value in the grossPay array. /* TODO: Create a function called getEmployeeNamesArguments :Name array(first and last name)Maximum sizeReturn the number of names filled.*/ /* TODO: Create a function calledgetHourlyPayArguments :NameArray(filled in Step 1)HourlyPayArray(starts empty)NumberOfNamesFilled(from Step1)*/ int main(){// TODO: Declare an array of strings for the employeeNames able to hold a maximum of SIZE employees// TODO: Declare arrays of double hourlyPay and grossPay, each able to hold a maximum of SIZE employees // TODO: Declare a 2-D array of doubles for the hours. It should hold a maximum of SIZE employees, each having 7 days.// TODO: Read in the employee names and return the numberOfEmployees. // TODO: Call your function to read in the hourly pay for each of the employees. // TODO: Read in the daily hours for each employee. There will be 7 entries per week. // NOTE: This prints the headers with a set width for each field. Follow this format for the entriescout << setw(20) << "Employee Name" << setw(12) << " Hours" << setw(10) << "Gross Pay" << endl;-// TODO: For each employee, print: name, total hours and gross pay // TODO: Call the function that finds the highest gross pay and print the corresponding employee name and gross pay.// HINT: consider finding the Index of the value rather than returning the actual highest gross pay.// TODO: Call the function to find the lowest gross pay and print the corresponding employee name and gross pay. return 0;}
For this c++ write a code for
Parallel Arrays
First, you have to define several arrays in your main program:
- employee names for each employee
- hourly pay rate for each employee
- total hours worked for each employee
- gross pay for each employee
code format:
// TODO: Add function prototypes for all the declared functions
// TODO: Declare two functions to compute the highestPay and lowestPay
// HINT: Each should return the index of the correct value in the grossPay array.
/* TODO: Create a function called
getEmployeeNames
Arguments :
Name array(first and last name)
Maximum size
Return the number of names filled.
*/
/* TODO: Create a function called
getHourlyPay
Arguments :
NameArray(filled in Step 1)
HourlyPayArray(starts empty)
NumberOfNamesFilled(from Step1)
*/
int main()
{
// TODO: Declare an array of strings for the employeeNames able to hold a maximum of SIZE employees
// TODO: Declare arrays of double hourlyPay and grossPay, each able to hold a maximum of SIZE employees
// TODO: Declare a 2-D array of doubles for the hours. It should hold a maximum of SIZE employees, each having 7 days.
// TODO: Read in the employee names and return the numberOfEmployees.
// TODO: Call your function to read in the hourly pay for each of the employees.
// TODO: Read in the daily hours for each employee. There will be 7 entries per week.
// NOTE: This prints the headers with a set width for each field. Follow this format for the entries
cout << setw(20) << "Employee Name" << setw(12) << " Hours" << setw(10) << "Gross Pay" << endl;
-
// TODO: For each employee, print: name, total hours and gross pay
// TODO: Call the function that finds the highest gross pay and print the corresponding employee name and gross pay.
// HINT: consider finding the Index of the value rather than returning the actual highest gross pay.
// TODO: Call the function to find the lowest gross pay and print the corresponding employee name and gross pay.
return 0;
}
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 7 steps with 6 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)