Question: C++ Task You will design a set of classes for storing student information, along with a class that will manage a list of students. Data
C++




Task You will design a set of classes for storing student information, along with a class that will manage a list of students. Data can be imported from files for storage in the list, and summary reports with computed final grades will be printed to output files Details 1. Design a set of classes that store student grade information. There should be one base class to store common data, and three derived classes that divide the set of students into three categories: English students, History students, and Math students. All data stored in these classes should be private or protected. Any access to class data from outside should be done through public member functions. The base class should allocate storage for the following data (and only this data): o o o student's first name (you may assume 20 characters or less) student's last name (you may assume 20 characters or less) Which course the student is in (English, History, or Math) 2. Each class should have a function that will compute and return the student's final average, based on the stored grades. All grades are based on a 100 point scale. Here are the grades that need storing for each subject, along with the breakdown for computing each final grade English-Attendance-1090. Project-30%, Midterm-30%, Final Exam-30% History-Term Paper-2596, Midterm-35%, Final Exam-4090 Math -- There are 5 quizzes, to be averaged into one Quiz Average (which can be a decimal number). Final grade computed as follows * Quiz Average = 15%. Test 1-25%. Test 2-25%, Final Exam: 35% 3. Write a class called studentList, which will be used to store the list of various students, using a single array of flexible size. Note that this array will act as a heterogeneous list, and it will need to be dynamically managed. Each item in the array should be a Student pointer, which should point to the appropriate type of object. Your list should only be big enough to store the students currently in it. Your StudentList class needs to have these public functions available o Studentlist) default constructor. Sets up an empty list o -Studentlist) destructor. Needs to clean up all dynamically managed data being managed inside a StudentList object, before it is deallocated o bool ImportFile (const char filename) This function should add all data from the given file (the parameter) into the internally managed list of students. The file format is specified below in this writeup. (Note that if there is already data in the list from a previous import, this call should add MORE data to the list). Records should be added to the end of the given list in the same order they appear in the input file If the file does not exist or cannot be opened, return false for failure. Otherwise, after importing the file, return true for success. o bool CreateReportFile (const char* filename) This function should create a grade report and write it to an output file (filename given by the parameter). Grade report file format is described below in this writeup If the output file cannot be opened, return false for failure. Otherwise, after writing the report file, return true for success. o void ShowList) const - This function should print to the screen the current list of students, one student per line. The only information needed in this printout is last name, first name, and course name. Format this output so that it lines up in columns Note that while this class will need to do dynamic memory management, you do not need to create a copy constructor or assignment operator overload (for deep copy) for this class. (Ideally we would, but in this case, we will not be using a StudentList object in a context where copies of such a list will be made) dentlist.h with the appropriate prototypes 4. Write a main program (in a separate file) that creates a single StudentList object and then implements a menu interface to allow interaction with the object. Your main program should implement the following menu loop (any single letter options should work on both lower and upper case inputs) Student List menu Import students from a file Show student list (brief) Export a grade report (to file) Show this Menu Quit Program The import and export options should start by asking for user input of a filename (you may assume it will be 30 chars or less, no spaces), then call the appropriate class function for importing a file or printing the grade report to file, respectively. (If the inport export fails due to bad file, print a message indicating that the job was not successfully completed) The "Show student list" option should call the class function that prints the brief student list to screen (names and course info only). The Show this Menu option should re-display the menu. Quit should end the menu program. (Until this option is selected, keep looping back for menu selections). Task You will design a set of classes for storing student information, along with a class that will manage a list of students. Data can be imported from files for storage in the list, and summary reports with computed final grades will be printed to output files Details 1. Design a set of classes that store student grade information. There should be one base class to store common data, and three derived classes that divide the set of students into three categories: English students, History students, and Math students. All data stored in these classes should be private or protected. Any access to class data from outside should be done through public member functions. The base class should allocate storage for the following data (and only this data): o o o student's first name (you may assume 20 characters or less) student's last name (you may assume 20 characters or less) Which course the student is in (English, History, or Math) 2. Each class should have a function that will compute and return the student's final average, based on the stored grades. All grades are based on a 100 point scale. Here are the grades that need storing for each subject, along with the breakdown for computing each final grade English-Attendance-1090. Project-30%, Midterm-30%, Final Exam-30% History-Term Paper-2596, Midterm-35%, Final Exam-4090 Math -- There are 5 quizzes, to be averaged into one Quiz Average (which can be a decimal number). Final grade computed as follows * Quiz Average = 15%. Test 1-25%. Test 2-25%, Final Exam: 35% 3. Write a class called studentList, which will be used to store the list of various students, using a single array of flexible size. Note that this array will act as a heterogeneous list, and it will need to be dynamically managed. Each item in the array should be a Student pointer, which should point to the appropriate type of object. Your list should only be big enough to store the students currently in it. Your StudentList class needs to have these public functions available o Studentlist) default constructor. Sets up an empty list o -Studentlist) destructor. Needs to clean up all dynamically managed data being managed inside a StudentList object, before it is deallocated o bool ImportFile (const char filename) This function should add all data from the given file (the parameter) into the internally managed list of students. The file format is specified below in this writeup. (Note that if there is already data in the list from a previous import, this call should add MORE data to the list). Records should be added to the end of the given list in the same order they appear in the input file If the file does not exist or cannot be opened, return false for failure. Otherwise, after importing the file, return true for success. o bool CreateReportFile (const char* filename) This function should create a grade report and write it to an output file (filename given by the parameter). Grade report file format is described below in this writeup If the output file cannot be opened, return false for failure. Otherwise, after writing the report file, return true for success. o void ShowList) const - This function should print to the screen the current list of students, one student per line. The only information needed in this printout is last name, first name, and course name. Format this output so that it lines up in columns Note that while this class will need to do dynamic memory management, you do not need to create a copy constructor or assignment operator overload (for deep copy) for this class. (Ideally we would, but in this case, we will not be using a StudentList object in a context where copies of such a list will be made) dentlist.h with the appropriate prototypes 4. Write a main program (in a separate file) that creates a single StudentList object and then implements a menu interface to allow interaction with the object. Your main program should implement the following menu loop (any single letter options should work on both lower and upper case inputs) Student List menu Import students from a file Show student list (brief) Export a grade report (to file) Show this Menu Quit Program The import and export options should start by asking for user input of a filename (you may assume it will be 30 chars or less, no spaces), then call the appropriate class function for importing a file or printing the grade report to file, respectively. (If the inport export fails due to bad file, print a message indicating that the job was not successfully completed) The "Show student list" option should call the class function that prints the brief student list to screen (names and course info only). The Show this Menu option should re-display the menu. Quit should end the menu program. (Until this option is selected, keep looping back for menu selections)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
