Question
Write a C (not C++) program that determines the commission average for each of up to 20 sales agents, then prints out a payroll summary
Write a C (not C++) program that determines the commission average for each of up to 20 sales agents, then prints out a payroll summary report (include block comments).
You must use the following structs to store your data:
struct sales_commissions {
float commissions[3]; }
struct sales {
char sales_name[30]; int sales_id struct sales_commissions;
} Your program should include the following functions(appropriately named):
Function1 which is called to get the Company Name up to 15 characters.
Function2 which is called to get the number of sales agents to process.
Function3 which is called to get the name, id number, and 3 commissions.
Function4 which is called to sort the data by id after all data is entered.
The dialog with the user must be as follows: (the welcome message can be designed of your own choosing)
Note: All text to the right of a colon : in the first section represents the input from the user. Indenting and spacing must be as above, no alterations.
Hints/Requirements:
Error checking is required on all numerical input for this program.
(1 < sales agents <= 20; 1< Id <= 99999, commissions >= 0)
Error messages for incorrect data is your choice.
Also, arrays and structs and functions are required in this program.
Use the Sample data above to test the calculations are correct
Decimals places should align in the report.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started