Question: Hi i want you to write a program in C programming that allows the user to to store and manipulate information of students. The user
Hi i want you to write a program in C programming that allows the user to to store and manipulate information of students. The user can add new students to the database, modify the existing ones, delete any student from the database, or search in the database. The program will also be able to load the data from a file and also save its information into a file.
On start of the program the following options will be shown:
1. Add
2. Modify
3. Delete
4. Search
5. Save
6. Load
7. Exit
1. Add: The program asks for information of a new student and adds it to the database. Note that it only adds the new student to the database and it will not add it to any file.
2. Modify: The program asks for a personal number. Then the program searches the database for the student with the given personal number. If there exists such a student in the database the program asks for new information (name, gender, study program, age, and email) and replaces the new information with the old information. If the student does not exist in the database, a message has to be shown.
3. Delete: The program asks for the personal number. Then the program searches the database for the student with the given personal number. If there issuch a student in the database the program deletesthe student from the database. If the student does not exist in the database an appropriate message has to be shown.
4. Search: In this case the program shows the following options:
1. Personal number
2. Name
3. Study Program
4. Statistics
For options 1 to 3 the program should ask for personal number, or name, study program and searches the database for the students that match the given criteria and print them out. If option 4 (Statistics) is chosen the program has to print out the following statistics:
Total number of students
Number of female and male students.
Average age of all students.
For each existing study program: number ofstudents, number of female and male students, and average age of students in the program.
5. Save: The program asks for a file name and saves all information in the database into the file. If the file exists, it will be overwritten and if it does not exist it has to be created.
6. Load: The program asks for a file name. If the file exists its contents will be loaded into the database. Note that the current information in the database will be overwritten by the information from the file. Therefore the program has to asks for a confirmation from user.
7. Exit: The program asksto save the database. Then it will do the same actionsin option 5 (Save) and then exits
Note: For each option write a function and avoid writing too much code in main() and allow the user to input how many student it want also use dynamic memory allocation!
Thanks in forehand :)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
