Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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 20 employees and save them in an array of employees. . Hint: To define an array that contains 20 elements of type 'struct employee', you just need to write: struct employee employees[20]; . 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 that take the array of all employees as input and sort it in an ascending way according to the employee age. There is no need for a return value to the function, but somehow the result must be assigned to the caller. Modify your program to include a function, which prints all the content of the employees array. The array of all employees acts as input and there is no return type of this function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Effective Delivery Effective

Answered: 1 week ago