Question: ( b ) [ 1 2 Points ] Ellipse class: Create a derived class representing a ellipse. [ - ] two private ints ( to

(b)
[12 Points] Ellipse class: Create a derived class representing a ellipse.
[-] two private ints (to designate the width and height of the object).
[+] implement a single constructor that, if called with 0 arguments, initializes a unit Rectangle at the origin -(0,0) and width = height =1, but if called with four arguments x, y, w, h, creates a Rectangle located at (x, y) with (width, height)=(w, h).(Hint: You will need to use default arguments.)
Support the following operations using the given function signatures:
[+] Get width, [+] Get height, [+] Set width, [+] Set height
[+] implement draw Shape function for Rectangle.
[+] implement area function for Rectangle that returns the area of the object.
(c)[12 Points] Circle class: Create a derived class representing a circle.
[-] one private ints (to designate the radius of the circle).
[+] implement a single constructor that, if called with 0 arguments, initializes a unit Circle at the origin -(0,0) and radius =1, but if called with three arguments x, y,r, creates a Circle located at (x, y) with (radius=r).
Support the following operations using the given function signatures:
[+] Get radius, [+] Set radius
[+] implement draw Shape function for Circle
[+] implement area function for Circle that return the area of the object.

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!