Programming in C please
Student Management System [100 Points] Expected LoC: 500 The goal is to implement a system that keeps track of students, courses and enrollments. Your system should be able to have enrollment and unenrollment capability and it should be able to answer the queries described in Table 1. Notes: . For simplicity you may assume the number of students and courses is given to you. First, the number of students (N) and courses (M) is given in the first line (space separated). Then the name of the students is given in the next N following lines. First name and last name is given separated by space in each line. Then the name of the courses follows in M lines (a course name may contain spaces so the whole line will be the course’s name). You may also opt to use a dynamically resizing array for extra credit. • The queries must be given to the program as text queries. Your program is responsible for understanding the query by the means of tokenizing and value checking). After the student and course names there comes a series of queries (each in a separate line) with the syntax defined above. For each query, print the result in a newline (except enroll, unenroll and grade). Queries can be either upper or lower case. One way of handling this, is to change everything to lowercase first and have selection statements on lowercase string literals. In all cases, if there are multiple results (course or student names), print them separated by comma-space (e.g. john doe, jane doe, john smith) in a newline. All the floating point numbers must be printed to exactly two decimal places. Exit the program if command “quit” is given in input. • Suggested approach to modeling our entities is to have an array of students and an array of courses (potentially using structs). The relationship between a course and a student can be modeled using a 2d array where the index in first dimension is the same as student’s index in students array and the index across the second dimension is the course’s index. The array[i][j] means whether the ith student is enrolled/graded in the jth course. • You may include extra prints outs to make your program appealing to human operator. Syntax enroll student firstname student.lastname course.name Explanation Enroll the student in that course. If already enrolled do nothing Syntax unenroll student firstname student.lastname course.name Explanation Drop that course for that student. If not enrolled do nothing Syntax grade student firstname student.lastname course.name grade.val Explanation Grade that student for that course! If not enrolled already do nothing Syntax ave course name Explanation Ave grade of the class (ignore ungraded). If no one is graded, print 0. Syntax spa student firstname student.lastname Explanation Compute the gpa of the student in their current courses (assume every course has same number of credits). If not graded print O. Syntax count course.name Explanation Total number of active enrollments in the given class. Syntax topstudent course.name Explanation Find the top student of the class. If no one is graded, print “N/A”. If more than one student are top students (same maximum grade), print them separated by comma and space. Syntax findmutual student firstname student.lastname Explanation Name of the students who take two or more classes together with the given student. Print first name and last names (with a space between them) separated by a comma (and space). If no one is found print “NA”. Syntax listcourses student firstname student.lastname Explanation List courses that the student is enrolled in. Separate each with a comma and a space (e.g programming in c, java fundamentals’)). Print “N/A” if not enrolled in any. Syntax findfirstnames student lastname Explanation Print all the students’ first names that share the same last name (comma space separated). Print “N/A” if no one matches the last name. Table 1: Required features’ syntax and what it means Example: Input 53 john doe jane doe john smith jane smith rooz beh programming using c analysis of algorithms general math 1 Expected output john, jane 95.00 92.50 jane doe programming using c, analysis of algorithms jane doe, john smith N/A jane doe findfirstnames smith enroll john doe programming using c enroll jane doe programming using c grade john doe programming using c 90 grade jane doe programming using c 100 ave programming using c unenroll john doe programming using c enroll john smith programming using c enroll john smith analysis of algorithms enroll jane doe analysis of algorithms grade jane doe analysis of algorithms 85 grade john smith programming using c 100 spa jane doe findmutual john smith listcourses john smith topstudent programming using c count analysis of algorithms topstudent general math 1 topstudent analysis of algorithms quit Show transcribed image text Student Management System [100 Points] Expected LoC: 500 The goal is to implement a system that keeps track of students, courses and enrollments. Your system should be able to have enrollment and unenrollment capability and it should be able to answer the queries described in Table 1. Notes: . For simplicity you may assume the number of students and courses is given to you. First, the number of students (N) and courses (M) is given in the first line (space separated). Then the name of the students is given in the next N following lines. First name and last name is given separated by space in each line. Then the name of the courses follows in M lines (a course name may contain spaces so the whole line will be the course’s name). You may also opt to use a dynamically resizing array for extra credit. • The queries must be given to the program as text queries. Your program is responsible for understanding the query by the means of tokenizing and value checking). After the student and course names there comes a series of queries (each in a separate line) with the syntax defined above. For each query, print the result in a newline (except enroll, unenroll and grade). Queries can be either upper or lower case. One way of handling this, is to change everything to lowercase first and have selection statements on lowercase string literals. In all cases, if there are multiple results (course or student names), print them separated by comma-space (e.g. john doe, jane doe, john smith) in a newline. All the floating point numbers must be printed to exactly two decimal places. Exit the program if command “quit” is given in input. • Suggested approach to modeling our entities is to have an array of students and an array of courses (potentially using structs). The relationship between a course and a student can be modeled using a 2d array where the index in first dimension is the same as student’s index in students array and the index across the second dimension is the course’s index. The array[i][j] means whether the ith student is enrolled/graded in the jth course. • You may include extra prints outs to make your program appealing to human operator.
Syntax enroll student firstname student.lastname course.name Explanation Enroll the student in that course. If already enrolled do nothing Syntax unenroll student firstname student.lastname course.name Explanation Drop that course for that student. If not enrolled do nothing Syntax grade student firstname student.lastname course.name grade.val Explanation Grade that student for that course! If not enrolled already do nothing Syntax ave course name Explanation Ave grade of the class (ignore ungraded). If no one is graded, print 0. Syntax spa student firstname student.lastname Explanation Compute the gpa of the student in their current courses (assume every course has same number of credits). If not graded print O. Syntax count course.name Explanation Total number of active enrollments in the given class. Syntax topstudent course.name Explanation Find the top student of the class. If no one is graded, print “N/A”. If more than one student are top students (same maximum grade), print them separated by comma and space. Syntax findmutual student firstname student.lastname Explanation Name of the students who take two or more classes together with the given student. Print first name and last names (with a space between them) separated by a comma (and space). If no one is found print “NA”. Syntax listcourses student firstname student.lastname Explanation List courses that the student is enrolled in. Separate each with a comma and a space (e.g programming in c, java fundamentals’)). Print “N/A” if not enrolled in any. Syntax findfirstnames student lastname Explanation Print all the students’ first names that share the same last name (comma space separated). Print “N/A” if no one matches the last name. Table 1: Required features’ syntax and what it means
Example: Input 53 john doe jane doe john smith jane smith rooz beh programming using c analysis of algorithms general math 1 Expected output john, jane 95.00 92.50 jane doe programming using c, analysis of algorithms jane doe, john smith N/A jane doe findfirstnames smith enroll john doe programming using c enroll jane doe programming using c grade john doe programming using c 90 grade jane doe programming using c 100 ave programming using c unenroll john doe programming using c enroll john smith programming using c enroll john smith analysis of algorithms enroll jane doe analysis of algorithms grade jane doe analysis of algorithms 85 grade john smith programming using c 100 spa jane doe findmutual john smith listcourses john smith topstudent programming using c count analysis of algorithms topstudent general math 1 topstudent analysis of algorithms quit
Expert Answer
Answer to Student Management System [100 Points] Expected LoC: 500 The goal is to implement a system that keeps track of students,…