Question
Write a C++ code that uses pure virtual functions in the baseclass universityperonnel. The universityperonnel class is anabstract class and no objects can be created
Write a C++ code that uses pure virtual functions in the baseclass universityperonnel. The universityperonnel class is anabstract class and no objects can be created for it. Your baseclass has two pure virtual functions getData() and isoutstanding().Your parent class should also include two member functionstoinput() and display() the name of personnel. Your code includes twoderived classes, student and instructor respectively. The derivedclasses each contain a function called get () and outstanding().get () function of Student class should input name of personnel andasks user to input GPA whereas outstanding function determineseither the GPA>3 or not. Similarly, get () function ofinstructor class should input name of personnel and asks user toinput no. of publications whereas Outstanding function determineseither the no. of publications >50 or not. Student andinstructor objects are casted into the person class type througharray of pointers. Ask user first either he is student/instructor,then get his data using get () and your program continues to ask toenter the data until the last personnel enters the data. Once thedata is entered, print names of all personnel along with theiroutstanding
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