Consider a Note Book class which is the base class that holds Data fields named manufacturer ID (of integer type) and manufacturer Name (of string type). • A two-argument constructor to initialize data-fields with user-defined values • Appropriate accessor and mutator functions to set and get values of data fields . Derive two classes from the Note Book class: • ENotebook, which contains an attribute size of integer type and a setter member function to set size value. • PaperNoteBook, which contains an instance variable named total Pages along with a member function to set total number of pages in a certain paper notebook object. • Both derived classes have function display to show all data field values (including values inherited from the base class). In the main() function, create objects of ENoteBook and PaperNoteBook classes and show the advantages of using protected access specifier. Both object display the all attributes and functionality of the respective cla
Consider a Note Book class which is the base class that holds Data fields named manufacturer ID (of integer type) and manufacturer Name (of string type). • A two-argument constructor to initialize data-fields with user-defined values • Appropriate accessor and mutator functions to set and get values of data fields
. Derive two classes from the Note Book class: • ENotebook, which contains an attribute size of integer type and a setter member function to set size value. • PaperNoteBook, which contains an instance variable named total Pages along with a member function to set total number of pages in a certain paper notebook object. • Both derived classes have function display to show all data field values (including values inherited from the base class).
In the main() function, create objects of ENoteBook and PaperNoteBook classes and show the advantages of using protected access specifier. Both object display the all attributes and functionality of the respective class.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images