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 comment).
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.

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 = 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.
The dialog with the user must be as follows: (the welcome message can be designed of your own choosing) \begin{tabular}{l} Welcome to the Sears Commission Analysis \\ Enter the Company Name: Jim's Cloud St \\ Enter the number of sales agents (120):33 \\ Incorrect number of sales agents, please re-enter. \\ Enter the number of sales agents (120):3 \\ Enter the name for sales agent 1: Paul Maul \\ Enter the id sales agent 1:4444 \\ Enter commission 1 for sales agent 1:1222 \\ Enter commission 2 for sales agent 1:333 \\ Enter commission 3 for sales agent 1:444 \\ Enter the name for sales agent 2: Gail storm \\ Enter the id sales agent 2:1234 \\ Enter commission 1 for sales agent 2:777 \\ Enter commission 2 for sales agent 2:2333 \\ Enter commission 3 for sales agent 2:49 \\ Enter the name for sales agent 3: Lee Ward \\ Enter the id sales agent 3:0056 \\ Enter commission 1 for sales agent 3:2222 \\ Enter commission 2 for sales agent 3:335 \\ Enter commission 3 for sales agent 3:777 \\ \hline \end{tabular}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
