Question: Write a C program with the following specifications: Write the definition of a structure named employee that contains character array members for an employee's first

Write a C program with the following specifications:
Write the definition of a structure named employee that contains character array members for an employee's first and last names of size 20, an int member for the employee's age, a char member that contains 'M' or 'F' for the employee's gender, and a double member for the employee's hourly salary.
Using the above-mentioned definition, write a C program that asks a user to enter the values of 5 employees and save them in an array of employees.
Hint: To define an array that contains 5 elements of type 'struct employee', you just need to write: struct employee employees [5];
Modify your program to include a function, which calculates the average salary of all employees. The function takes as input the array of all employees and returns the average salary as float value.
Modify you program to include a function that take the array of all employees as input and return the employee record with the youngest age. If there is more than one employee with the same youngest age, the program should return one of them.
Modify your program to include a function, which prints all the content of the employee's array. The array of all employees acts as input and there is no return type of this function.
 Write a C program with the following specifications: Write the definition

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!