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

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.4: Class Inheritance And Polymorphism
Problem 5E
icon
Related questions
Question

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.

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Software Development
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning