Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description A company is planning to hire a number of temporary workers who are paid hourly and you are given a data file that contains

image text in transcribed
image text in transcribed
image text in transcribed
Description A company is planning to hire a number of temporary workers who are paid hourly and you are given a data file that contains the last name of the employees, the amount of hours worked by the employee for the week, and their hourly wage. You are asked to write a program that computes each employee's weekly pay and the average salary of all the workers. The program then outputs the weekly pay of each employee, the average weekly pay, and the names of all the employees whose pay is greater than or equal to the average pay (Sorted by the last name, you will also need to format the name so the first letter is capital and the rest are lower case, using the format function). If the number of hours worked in a week is more than 40 hours, then the pay rate for the hours over 40 is 1.5 times the regular hourly rate for each hour above 40. In this assignment, instead of using parallel arrays, you will use an array of structs to hold the employees' names, hours worked, hourly pay, and amount earned, the definition of the struct can be seen below struct employeeType string name; double hours; double hourlyPay; double amountEarned; Where string name holds the name of the employee, double hours wl hold the hours the employee has worked, double hourlyPay wl hold the hourly pay for the employee, and double amountEarned wi be the total weekly wage. So unlike the last assignment, you won't have two parallel arrays, you wl have an array of structs and each element of the array will hold all the information for each employee. You will write the following functions string format (string) this function wl format the string passed as a parameter and return this string in the format where the first letter is upper cased and the rest of the characters wil be lower cased void readData (employeeType[], int&, ifstream&) this function takes in the struct array of the employee's info, the array counter, and the input filestream, you will populate the struct array with the elds of each struct and you will increment the array counter contents of the file into the appropriate f after each line has been read void bubblesort (employeeType[], int) this function takes the struct array with its counter and will sort the array by name

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

2. Discuss various aspects of the training design process.

Answered: 1 week ago

Question

5. Discuss the key roles for training professionals.

Answered: 1 week ago