Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a menu driven C program, for manipulating the records of students in a classroom. The class may include at most 25 students. (Using unions

Write a menu driven C program, for manipulating the records of students in a classroom. The class may include at most 25 students.

(Using unions and enumerated data) types,

define a structure for students with different majors Each student should have a student name, student ID, student major (Biology, Mathematics, or Chemistry) and student average. If the student has a (Biology major), then they should have marks for 106 and one for 206. Those having a (Mathematics major) should have marks for 101 and 102. Those with a (Chemistry major) should have marks for 101, 102, and 113. ----- #( a separate functions to perform the following menu) 1)Add a new student to the classroom. 2) Delete a student from the classroom. 3) Modify the record of a particular student given his name or ID number. 4)Print the record of a particular student given his name or ID number. 5)Print the records of all the students in the classroom. 6)Exit the program #( that mean 6 function (adding , deleting, modifying ,print particular student ,print all student and Exit))

IMPORTANT REMAKRS: 1'When adding a new student, your program should input a student name and their ID, enter their major along with the marks needed according to the major, and then compute the average according to the marks stored in the structure. Only one student is added with each add option. No two students share the exact name. No two students share the exact ID number. Search for the student using a recursive sequential search algorithm to make sure if they exist.

2-The user is allowed to delete a student based on either the student's unique name or ID number. The order of the students in the array should not be changed. Use shifting within the array to shift the elements so as to delete the unwanted student from the array.

3-The user can modify the marks of the student given his name or ID number. The marks modified are dependent on the major of the student. Make sure to recalculate the average after the modification. 4- Implement a recursive function to print the records of all the students in the classroom.

5- Make sure all error messages are accounted for (e.g. printing the students from an empty list, deleting a non-existing student, etc.)

------------------ THE BEGINNING SHOULD BE LIKE :

typedef struct { Char name [20]; int id; Double avrage;

enum { biology=1, Mathematics, Chemistry } major ; Union { Struct { b1 ,b2}bioMarks; Struct { m1 ,m2}mathMarks; Struct { c1 ,c2, c3}chemMarks; }Sub; } students ;

((I need the function and it's main )) ((Make sure that there are 6 function for (adding , deleting, modifying ,print particular student ,print all student and Exit))

#IN C PROGRAMMING LANGUAGE

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

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions

Question

=+What is the extent of the use of each type of IE?

Answered: 1 week ago