Define two class types: Student and Graduate, where Graduate inherits from St udent. Class Student includes (1) member variables: name, id, and score (protected) (2) member functions: (public) a default constructor Student:Student(): name("no name"), id(0), score (0) constructor Student:Student(string n, int i, double s): name(n), id(i), scor e(s). void output() Class Graduate has (1) additional member variables: string supervisor; (private) (2) additional member functions: (public) a default constructor Graduate::Graduate(): Student(),supervisor("no na me") constructor Graduate: Graduate (string n, int i, double s, string sn): Stude nt(n,I,s), supervior(sn). void output() ---redefine the function Define three graduate student g1, g2,g3 in main function (1) Input the information for g1 from the keyboard; (2) Initialize the information for g2 when it is declared (using default construct or); (3) Initialize the information for g3 when it is declared (using normall construct
Define two class types: Student and Graduate, where Graduate inherits from St udent. Class Student includes (1) member variables: name, id, and score (protected) (2) member functions: (public) a default constructor Student:Student(): name("no name"), id(0), score (0) constructor Student:Student(string n, int i, double s): name(n), id(i), scor e(s). void output() Class Graduate has (1) additional member variables: string supervisor; (private) (2) additional member functions: (public) a default constructor Graduate::Graduate(): Student(),supervisor("no na me") constructor Graduate: Graduate (string n, int i, double s, string sn): Stude nt(n,I,s), supervior(sn). void output() ---redefine the function Define three graduate student g1, g2,g3 in main function (1) Input the information for g1 from the keyboard; (2) Initialize the information for g2 when it is declared (using default construct or); (3) Initialize the information for g3 when it is declared (using normall construct
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 7SA: Assume the definition of class foodType as given in Exercise 6. Answer the following questions? (1,...
Related questions
Question
100%
Please solve the
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr