In c++ Create a new project named lab11_1. You will be implementing three classes: A Clothing class, a Shirt class, derived from Clothing and third class of your choice that will be derived from Clothing. I have included the UML diagrams for Clothing and Shirt. You will need to make sure that the class you derive from Clothing is appropriate, meaning it makes sense that it would inherit from Clothing. In your driver file, I’d like to see a Shirt object created, as well as an object of the class type that you create. Set the class variable members to specific values, and then print. You can choose to override the output operator to make this easier, or you can implement a method named print(). Create a new project named lab11_2. Come up with your own base class, and derived class. No big specifications here on what you need to do (in terms of overloading operators, friend functions, static variables, composition, etc), but you have to make use of the base class members in the derived class. Remember, this is an is-a relationship, not a has-a relationship. Be creative!
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
In c++
Create a new project named lab11_1. You will be implementing three classes: A Clothing class, a Shirt class, derived from Clothing and third class of your choice that will be derived from Clothing. I have included the UML diagrams for Clothing and Shirt. You will need to make sure that the class you derive from Clothing is appropriate, meaning it makes sense that it would inherit from Clothing.
In your driver file, I’d like to see a Shirt object created, as well as an object of the class type that you create. Set the class variable members to specific values, and then print. You can choose to override the output operator to make this easier, or you can implement a method named print().
- Create a new project named lab11_2. Come up with your own base class, and derived class. No big specifications here on what you need to do (in terms of overloading operators, friend functions, static variables, composition, etc), but you have to make use of the base class members in the derived class. Remember, this is an is-a relationship, not a has-a relationship. Be creative!
Trending now
This is a popular solution!
Step by step
Solved in 9 steps with 1 images