"For Saurabheights only"
|
1. (TCO 2) Keeping in mind all object-oriented programming best practices, create a class for a Bookcase, with the following specifications: 1) Specify two data members 2) Default Constructor 3) Overloaded Constructor which takes both data member values as input. 4) Generate a unique identification number for each object instantiated from this class. Use a static data member to keep track of the identification number last assigned to an object so that duplications will not occur. Code the necessary portion of the class definition so as to support this requirement. 5) Show a statement which instantiates an object of this class using the overloaded constructor. You do not need to provide any accessor/mutator methods or other methods.
Question 3.3. (TCO 4) Consider the class Apple. Given your knowledge of some common components of apples - show a class hierarchy in which the class Apple inherits from other classes, which, in turn, can also be inherited from yet other classes; - discuss inheritance from class Apple for other closely related derived classes; and - discuss the common components of class Apple. (Points : 18) |