Search for question
Question

Write a C program that calculates the total salary, total age and the bonus of one of the departments of the company. The program's design should use only the main

function. The expected output should contain your name, your CS 159 section number and your ID as shown in the sample output. The main function should run successfully with different scenarios. The main function should perform the following Prompt the user to enter the age of four employees by using a while bop. The main function should then calculate and print the average age of all employees who are older than or equal to thirty years and the total age of all employees. Prompt the user to enter the salary of four employees by using a while loop. The main function then calculates and returns the total alary after applying the following deduction. Prompt the user to enter the gender (M or F) of four employees by using a while loop. The main function should then print the number of female employees and the number male employees in the department as in the sample output below. ( Prompt the user to enter an integer number (Rank) and then by using a nested if statement, the main function should calculate the bonus according to the rules given in the following table. The function should then ask the user to enter the ID of the department and then prints the rank, the bonus, and the ID of the department as shown in the sample output below.

Fig: 1

Fig: 2

Fig: 3

Fig: 4

Fig: 5

Fig: 6

Fig: 7