From now on, all your classes must be designed in the Orthodox Canonical Form. The class would implement with these four required member functions:
- Default constructor
- Copy constructor
- Copy assignment operator
- Destructor
Every time C++ creates its few elements in the class when it compiles. From now on your all class must be designed in Orthodox Canonical Form. Let’s start with a simple exercise.
- Implement Car class
- Member variable
- name
- speed
- Member function
- Constructor
- Copy constructor
- Copy assignment operator override
- Destructor
- Member variable
- Make an example with main function
Inheritance is a fundamental concept of Object-Oriented Programming (OOP) that allows creating new classes based on already existing classes, thereby enabling code reusability and reducing code duplication. Inheritance allows a derived class to inherit properties and behaviors from a base class.
- Implement Car Class
- Member variable
- make
- model
- year
- Member function
- void drive();
- Just print something like Driving "make" "model" "year" edition.
- void drive();
- Member variable
- Implement Sports Car
- inherit from Car class
- Member variable
- top speed
- Member function
- void drive();
- Just print speed in addition to Car class's drive func.
- void drive();
Expand the above example of Car to demonstrate all the main concepts of OOPs, including abstraction, encapsulation, inheritance, polymorphism, and modularity. Surprise yourself on what you can do (and can not do)!
Fill in this Evaluation Form Module01. You need to collect 2 feedbacks from 2 peers from other than your own team.