Create a class Student that contains information about a student’s name, semester, roll no, and date of admission. To store the date of admission, use a structure to define date. Provide a. a no-argument constructor for initializing the values of data members to some defaults. b. a 4-argument constructor to initialize the data members sent from the calling function at the time of creation of an object (date should be sent from outside in the form of a date object). c. An input function for setting the status of a student. d. A display function to display all the attributes of a student. Derive a class undergraduate from Student class that contains some additional information. This information is about the semester GPA of a student and the credit points earned per semester. To store this data, provide a 2D array (2x8 array since at maximum there are 8 semesters for an undergraduate program). One dimension of the array should hold information about the SGPA of each semester so far and the other dimension should hold the corresponding credit points earned in that semester. a. Create a no-argument and a 5-argument constructor for data member initialization. b. Provide overridden functions for getting and setting the data members. c. Provide another function to calculate the CGPA of student based on the information provided by the 2D array. Derive a class Graduate from Student class that also has the same additional information as the Undergraduate class but in this case, the array is 2x4 since at maximum there are four semesters in a Graduate program. There are two additional data members: one to store the title of the last degree held and another to store the area of specialization in graduate program. Provide appropriate constructors and overridden member functions. Write a main function to test this class.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Create a class Student that contains information about a student’s name, semester, roll no, and date of admission. To store the date of admission, use a structure to define date.
Provide
a. a no-argument constructor for initializing the values of data members to some defaults.
b. a 4-argument constructor to initialize the data members sent from the calling function at the time of creation of an object (date should be sent from outside in the form of a date object).
c. An input function for setting the status of a student.
d. A display function to display all the attributes of a student.
Derive a class undergraduate from Student class that contains some additional information. This information is about the semester GPA of a student and the credit points earned per semester. To store this data, provide a 2D array (2x8 array since at maximum there are 8 semesters for an undergraduate program). One dimension of the array should hold information about the SGPA of each semester so far and the other dimension should hold the corresponding credit points earned in that
semester.
a. Create a no-argument and a 5-argument constructor for data member initialization.
b. Provide overridden functions for getting and setting the data members.
c. Provide another function to calculate the CGPA of student based on the information provided by the 2D array.
Derive a class Graduate from Student class that also has the same additional information as the Undergraduate class but in this case, the array is 2x4 since at maximum there are four semesters in a Graduate program. There are two additional data members: one to store the title of the last degree held and another to store the area of specialization in graduate program. Provide appropriate constructors and overridden member functions.
Write a main function to test this class.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images