Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please read and follow guidelines for creating the code. Must be a C language code. Please create the two functions and DO NOT change the
Please read and follow guidelines for creating the code. Must be a C language code. Please create the two functions and DO NOT change the main. Functions must work with the main.
Problem 3 (64 points)-Write a program Submit a program called business.c In a certain country, it is required by law that all businesses follow a certain company structure and pay scale. No fewer than 6 workers are allowed and for every 2 workers there must be a manager. If there is an odd number of workers, than one manager will have 3 workers (but still the same pay as others). For every three managers, there must be a director-the maximum number of managers that can be handled by a director is 5. If there are less than 3 managers (1 or 2, for example), then no director is present. The ruler of this particular country has asked you to create a program that would allow a business owner to enter a monthly budget, the number of workers and a worker's monthly salary. A director makes five times the amount a worker makes and a manager makes half of what a director makes. The program should let the business owner know the total that would be spent and if the total spent goes under or over budget. The user should then have the option to rebudget. The problem should only stop when the user does not want to rebudget-it should keep going otherwise. (see sample run) 1. Given the following main function (see below), define the two functions that are used in the main a. float print out (float* salary, int num of emps); b. int rebudget(float d, float "budget); 2. Combine the functions you defined in part one with the following main function to create a working program (sample run follows). NO CREDIT IF YOU MODIFY THE MAIN FUNCTION OR THE FUNCTION DECLARATIONS Main function int main(int argc, char *argv) O Type here to search NE Main function: int main(int argc, char argv) int i-1; float budget, total, salary; float "money-ptr=&salary; float *total-ptr=&total; int employees; printf Enter monthly budget:$"): scanf("%f", &budget); while(i) printf" Enter monthly worker salary: S"); scanf("%f", &salary); printf Enter total workers:) scanf("%d", &employees); total-print out(money ptr, &employees): i-rebudget(total ptr, &budget); Type here to search Sample Run Enter monthly budget: $500000 Enter monthly worker salary: $2500 Enter total workers: 11 *Employee info:** Total workers: 11 Monthly salary: $2500.00 Total managers: 5 Monthly salary: $6250.00 Total directors: 1 Monthly salary: $12500.00 Total spent: $71250.00 -This goes UNDER your budget by $428750.00. Would you like to rebudget? 1 for yes 2 for no. Enter monthly worker salary: $5600 Enter total workers: 14 *Employee info:** Total workers: 14 Monthly salary: $5600.00 Total managers: 7 Monthly salary: $14000.00 Total directors: 2 Monthly salary: $28000.00 Total spent: $232400.00 --This goes UNDER your budget by $267600.00 O Type here to search Employee info:* Total workers: 11 Monthly salary: $2500.00 Total managers: 5 Monthly salary: $6250.00 Total directors: 1 Monthly salary: $12500.00 Total spent: $71250.00 --This goes UNDER your budget by $428750.00 Would you like to rebudget? 1 for yes 2 for no Enter monthly worker salary: $5600 Enter total workers:14 Employee info:" Total workers: 14 Monthly salary: $5600.00 Total managers: 7 Monthly salary: $14000.00 Total directors: 2 Monthly salary: $28000.00 Total spent: $232400.00 --This goes UNDER your budget by $267600.00 $280.00 Total spent $2,32400.0 Would you like to rebudget? 1 for yes 2 for no 2 Bye! O Type here to search SiStep 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