Question
Task You will design a set of classes for storing student information, along with a main program that will read student information from a file,
Task
You will design a set of classes for storing student information, along with a main program that will read student information from a file, store the data, compute final grades, and then print a summary report to an output file.
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 student's first name (you may assume 20 characters or less)
o student's last name (you may assume 20 characters or less)
o Which course the student is in (English, History, or Math)
Separate specifications from your implementation. Submit your program as YourName_LastName_B5.cpp, your header file (YourName-B5.h), and YourName_main-B5.cpp files.
At the beginning of your program in comment section write your group members and their responsibilities. Also, you must include which function(s) or method(s) is/are implemented by whom in the group.
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 = 10%, Project = 30%, Midterm = 30%, Final = 30%
History -- Term Paper = 25%, Midterm = 35%, Final = 40%
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 = 35%
3.Write a main program (in a separate file) that does the following (in this order):
a) Ask the user for input file name and display output on screen. (See the sample run below).
b) Read the student data from the input file and store it using an array of appropriate type. You will need to allocate this list dynamically (if you are not using vectors), since the size is stored in the input file. Each student's data should be stored in a separate object. (Any dynamically allocated space should be cleaned up appropriately with delete when you are finished with it).
c) Print a summary report to the screen, as specified below. You'll need to use the function that computes the final average when you do this, since the final averages will be included in this summary report.
4. File formats
Input File -- The first line of the input file will contain the number of students listed in the file. This will tell you how big a list you need. After the first line, every set of two lines constitutes a student entry. The first line of a student entry is the name, in the format lastName, firstName. Note that a name could include spaces -- the comma will delineate last name from first name. The second line will contain the subject ("English", "History", or "Math"), followed by a list of grades (all integers), all separated by spaces. The order of the grades for each class type is as follows:
English -- Attendance, Project, Midterm, Final
History -- Term Paper, Midterm, Final
Math -- Quiz 1, Quiz 2, Quiz 3, Quiz 4, Quiz 5, Test 1, Test 2, Final
5. General Requirements
o No global variables, other than constants!
o All member data of your classes must be private or protected
o Use the const qualifier on member functions wherever it is appropriate.
o You may use any of the standard libraries that have been discussed in class (iostream, iomanip, fstream, as well as C libraries, like cstring, cctype, etc). You may also use the string class library if you wish.
Sample run
Screen input and output: (keyboard input is underlined)
Please enter the name of the input file. Filename: test.txt Processing!
Here is result:
Student Grade Summary ---------------------
ENGLISH CLASS
Student Final Final Letter
Name Test Avg Grade
----------------------------------------------------------------
Marvin Dipwart 88 80.30 B
James T. Kirk 88 80.80 B
HISTORY CLASS Student Final Final Letter
Name Test Avg Grade
----------------------------------------------------------------
Joe Schmuckatelli 90 84.25 B
Monica Lewinsky 78 71.40 C
MATH CLASS
Student Final Final Letter
Name Test Avg Grade
----------------------------------------------------------------
Bugs Bunny 93 94.83 A
Jimmy Crack Corn 68 65.33 D
Sample input file:
6
Bunny, Bugs Math 90 86 80 95 100 99 96 93
Schmuckatelli, Joe History 88 75 90
Dipwart, Marvin English 95 76 72 88
Crack Corn, Jimmy Math 44 58 23 76 50 59 77 68
Kirk, James T. English 40 100 68 88
Lewinsky, Monica History 60 72 78
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started