Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a menu based C program to maintain the Employees records. Your program should take the following inputs: 1. Employee first name (max. 25 characters)

Write a menu based C program to maintain the Employees records. Your program should take the following inputs:

1. Employee first name (max. 25 characters) 2. Employee last name (max. 25 characters) 3. Employee Phone No (10 characters .e.g.1112223344) 4. EmployeeSalary(int,e.g.100000)

You need to create a structure Employee with above information. Then, create a linked list where each list node contains an Employee. Your program should be able to take records of a minimum of 5 employees. After taking the records, you should provide 7 functionalities to the user.

Print records prints records of all employees.

Add a new record take a new record from the user for a new employee. Create a node for the new employee and add it to the beginning of the list.

Delete record(s)todeletearecord,askforthelastnameoftheemployeefromthe user. If there are multiple employees with same last name, you must delete all of their records (you have to delete corresponding list nodes).

Search by Phone NoprintsrecordoftheemployeewithagivenPhoneNo.

Search by Salary range take two Salary max, min; then print records of all employees who have salary between [max, min] (inclusive).

Find the median salary compute the median salary and print it. Also, print how many employees are above this median salary (do not forget to sort the list to compute median).

Exit the programterminate on a specific input from the user. Let that specific input be an integer of value 0.

You should print the record in the following format:

First Name: firstname1, Last Name: lastname1, PhoneNo.: phoneno_1, Salary: salary_1 First Name: firstname2, Last Name: lastname2, PhoneNo.: phoneno_2, Salary: salary_2 ... First Name: firstname5, Last Name: lastname5, PhoneNo.: phoneno_5, Salary: salary_5

You should write each functionality from 1-7 in separate functions. You should provide a menu to the user as following:

For inputs:

Please indicate number of records you want to enter (min 5): # of records After user gives the number of records, you should inform the user how to enter the records: Please input records of employees (enter a new line after each record), with following format: first name last name phoneNo salary

After user gives the inputs for the records, inform the user about the functionalities: Print records (press 1) Add a new record (press 2) Delete record(s) (press 3)

Search by phoneNo (press 4) Search by salary range (press 5) Find median salary (press 7) Exit the program (press 0)

After user chooses a functionality, your program performs that and provides this menu again to select another functionality. This goes on until user presses 0.

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

Recommended Textbook for

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions