Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

How do you talk about your complaining customers?

Answered: 1 week ago