p.s. please use structures and functions also the program is required to use an input file it cannot ask the user to inp
Posted: Tue Jul 05, 2022 10:26 am
p.s. please use structures and functions also the program is required to use an input file it cannot ask the user to input the information for each of the 30 employees it has to read that information from the .txt file. please post the input file that you use for the program
Thank you for your help
Using a structure, and creating three structure variables; write a program that will calculate the total pay for thirty (30) employees. (Ten for each structured variable.) Sort the list of employees by the employee ID in ascending order and display their respective information. Description Employee IDs Hours Worked Pay Rate Total Pay Structure name administrative office field DataType of INT of DOUBLE of DOUBLE of Double payroll structure variable structure variable structure variable Name of function Properties of function Definition of Function Members employees jd hrworked_jd payrate_jd total_pay_jd Read Input File get_jd Called from main 4999 Should pass hours worked and pay rate Array Size Excluding the main function, your program should have four additional functions that will get the hours worked, and payrate, calculate the total pay, sort the data and display your output. 10 Base pay should be calculated by multiplying the regular hours worked by pay rate. If a person has worked over forty (40)hours, total pay is calculated by an adding 10% of base pay for every five (5) hours over forty (40) to base pay. (ie a person working 50 hours with a total pay of $100 would have ((hours-40)/5)*(base pay*.1) + base pay. 10 Note: jd represents the initials of the programmer. Your function names should be named by replacing the initials jd with your first and last initials 10 Calculate Pay calc_jd Called from main Should pass hours worked and pay rate and calculated total pay Sort Data sort_jd Called from main Sort data by student ID using the bubble or selection sort passing all variables Output Results prt_jd Called from main Should pass employee id, hours worked, pay rate and total pay. Then print the data.
Thank you for your help
Using a structure, and creating three structure variables; write a program that will calculate the total pay for thirty (30) employees. (Ten for each structured variable.) Sort the list of employees by the employee ID in ascending order and display their respective information. Description Employee IDs Hours Worked Pay Rate Total Pay Structure name administrative office field DataType of INT of DOUBLE of DOUBLE of Double payroll structure variable structure variable structure variable Name of function Properties of function Definition of Function Members employees jd hrworked_jd payrate_jd total_pay_jd Read Input File get_jd Called from main 4999 Should pass hours worked and pay rate Array Size Excluding the main function, your program should have four additional functions that will get the hours worked, and payrate, calculate the total pay, sort the data and display your output. 10 Base pay should be calculated by multiplying the regular hours worked by pay rate. If a person has worked over forty (40)hours, total pay is calculated by an adding 10% of base pay for every five (5) hours over forty (40) to base pay. (ie a person working 50 hours with a total pay of $100 would have ((hours-40)/5)*(base pay*.1) + base pay. 10 Note: jd represents the initials of the programmer. Your function names should be named by replacing the initials jd with your first and last initials 10 Calculate Pay calc_jd Called from main Should pass hours worked and pay rate and calculated total pay Sort Data sort_jd Called from main Sort data by student ID using the bubble or selection sort passing all variables Output Results prt_jd Called from main Should pass employee id, hours worked, pay rate and total pay. Then print the data.