Question: 1) Modify the class Point to add the prototypes and write code for methods to set and retrieve the value of each of the data

1)

Modify the class Point to add the prototypes and write code for

methods to set and

retrieve the value of each of the data members as well as

prototypes for

all

required methods and operators

.

(20

p

oin

ts)

2)

Do the following with

class Shape:

a.

Add prototypes for all

required

methods a

nd operators for the class

(the

Point class is the one from problem o

ne above). (15 points)

b.

Add prototypes for methods Area and Perimeter that will return values of

template type T (these will be requi

red

methods

in derived classe

s so write

them appropriately).

(15 points)

c.

Write the method GetOrigin to return the Origin of the class.

(10 points)

d.

Write the method SetOrigin to allow someone to set the value of the

Origin of the class.

(10 points)

e.

Derive c

lasses

Circle and Rectangle from Shape

(10 points)

i.

Add

any necessary data members and prototype

s for all required

functions.

( 10 points)

ii.

Show how

the

constructors will use the appropriate methods of the

base class. (

10

pts)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!