Question: Write a menu based program to maintain student records. Your program should take the following inputs: 1. Student first name (max. 20 characters) 2. Student
Write a menu based program to maintain student records. Your program should take the following inputs:
1. Student first name (max. 20 characters)
2. Student last name, (max. 20 characters)
3. Student scores (float/double), eg. 85.4
4. Zip code (may be a string)
You have to create a structure Student with above information. Then create a linked list where each list node contains a Student. Your program should be able to take records of a minimum of 5 students. After taking the records, you should provide 7 functionalities to the user.
1. Print records prints records of all students
2. Add a new record take a new record from the user for a new student. Create a node for the new student and add it to the end of the list.
3. Delete record(s) to delete a record, ask for the last name of the student from the user. If there are multiple students with same last name, you must delete all of their records (you have to delete corresponding list nodes).
4. Search by Zip code prints records of all students with a given zip code.
5. Search by score range take two scores max, min; then print records of all students who have scores between [max, min] (inclusive).
6. Find the median score compute the median score and print it. Also, print how many students are above this median score (do not forget to sort the list to compute median).
7. Exit the program terminate 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: firstname 1, Last Name: lastname 1, Score: score 1 Zip code: code 1 First Name: firstname 2, Last Name: lastname 2, Score: score 2 Zip code: code 2 . . . 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 students (enter a new line after each record), with following format first name last name score zip code 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 zip code (press 4) Search by score range (press 5) Find median score (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. Instruction:
Do not forget to use - malloc for a new node - free to delete it.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
