Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

in c++ Student Types The following diagram illustrates the classes you will implement in this lab and their relationships. myDate (-) day Type: int (-)

in c++ image text in transcribed
image text in transcribed
image text in transcribed
Student Types The following diagram illustrates the classes you will implement in this lab and their relationships. myDate (-) day Type: int (-) month Type: int (-)year Dype: int (+) Parameterized Constructor (+) Setters (+) print Details :void Private Public Private Student (-) name Type: string (-) major Type: string (#) EnrollDate Sype: myDate (+) Parameterized Constructor that takes 2 strings and 1 myDate object () Getter for the major (+) print Details :void Public Undergraduate (-) GPA Type: Float (-) Graduation project Type: string (+) Parameterized Constructor (+) print Details :void (+) Change Enrollment Date: void graduate (-) iSTA Type: bool (-) thesis name Type: string (+) Parameterized Constructor (+) printDetails :void (+) getMajor : string NOTE 1: In all of your code, do not forget to make all functions that do not modify the class constant NOTE 2: Do not put all of your code in one file; separate implementation from the interface. NOTE 3: Avold duplication of code! If something is already done in the base class, do not do it again in the derived class. QUESTION 1: Implement class myDate as described in the UMI. diagram. Don't forget to validate the data members. The year should be between 1900 and now. QUESTION 2: Implement class student as described in the UML diagram. Notice that unlike all its data members, EnrollDate is protected and not private in this class. Function printDetails should print information about the Student in a well-formatted manner. QUESTION 3: Implement class undergraduate, which inherits from dass student. Note the following: The GPA data member represents the average grade of the student The Graduation project data member is the name of the student project. Function printDetails of the base class should be overridden to print the additional information about the GPA and graduation project. Function Change EnrollmentDate should change the EnrollDate of the base class according to the given parameter. The function take three integers that represent the day, the month and the year. QUESTION 4: Implement class graduate, which inherits from class student. Note the following: The is TA data member will be true if the student is TA. The thesis_name data member is the name of the student thesis. Function getMajor in the base class should be overridden to return the major + "(GRADUATE)" Function printDetails of the base dass should be overridden to print the additional information about whether the student is TA or not and his thesis name. QUESTIONS: Implement a driver program to test your code. Create an object of type undergraduate, assign the appropriate values for each data member, and don't forget to assign values to parent class data members. - Create an object of type graduate, assign the appropriate values for each data member, and don't forget to assign values to parent class data members. - Print the details of both objects. - Print out the major of the graduate student in main. change the EnrollDate of the undergraduate object you created earlier to (1/1/2021) using one C++ statement. Reprint the details of the student to make sure that the effect is made to the date. - if you use private or protected inheritance, would you be still able to call the function Change EnrollmentDate? Why or why not? Answer this part as a comment in your main. Sample output: the details of the undergrad student: the name of the student is ahmad the major of the student is EE the enrollement date of the student is 16 / 7 / 1990 the student GPA 15 75.7 the name of the graduation project is solar energy the details of the graduate student: the name of the student is sara the major of the student is cs the enrollement date of the student is 4 / 7 / 2002 the thesis name of the student is Data Hiding the student is not TA the major of the graduate student is cs (Gradute) the details of the undergrad student after the date change: the name of the student is ahmad the major of the student is EE the enrollement date of the student 1s 1 / 1 / 2021 the student GPA 13 75.7 the name of the graduation project 19 solar energy

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_2

Step: 3

blur-text-image_3

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students explore these related Databases questions