Create a base shape class and its successor a rectangle


TITLE

- Development and Implementation of Shape Class

OBJECTIVE

- To test students' capabilities of understanding on object oriented programming (OOP) in C++.
- To implement OOP in developing shape classes and use them to draw (print) objects.

- To improve students' imagination by giving space of creativity.

ASSIGNMENT DESCRIPTION

You are required to create shape classes and use them to build an application in text mode console (not graphic mode).

TASK 1

In first task, you are required to create a base Shape class and its successor a Rectangle elassids The base class is called Shape class. The Shape class has few methods and attributes.

shows the minimum methods and attributes that the class should have. Student can (or should) add more methods and attributes to make the class works. Student can modify methods and attributes name.

Rectangle class is the inheritance of Shape class. Rectangle class can access to all (or some) methods and attributes of Shape class. To determine which methods and attributes derived from the base class, student has to understand the concept of inheritance and encapsulation.

For example, a rectangle is formed of four lines. Therefore, Rectangle class must have ability to print lines. In the other hand, when draw method in Rectangle class is called, Rectangle class calls line methods of Shape class (not creating own methods).

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create a base shape class and its successor a rectangle
Reference No:- TGS01480954

Now Priced at $10 (50% Discount)

Recommended (92%)

Rated (4.4/5)