Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please follow the instructions and solve it by C++. Please and thank you! Implement the Circle class so that the following minimal test code can

Please follow the instructions and solve it by C++. Please and thank you!

Implement the Circle class so that the following minimal test code can be satisfied.

int main()

{

const int SIZE = 3;

Circle * arrCircle[SIZE] = {nullptr};

/// Create a Circle whose serial number is 1001 and the radius is 20.

/// Type 'C' indicates Circle type.

arrCircle[0] = new Circle('C', 1001, 20);

/// Create a Spray whose serial number is 1002, the radius is 20, and the density is 30%.

/// Type 'S' indicates Spray type.

arrCircle[1] = new Circle('S', 1002, 25, 30);

/// Create a Spray whose serial number is 1003, the radius is 40, and the density is 80%.

arrCircle[2] = new Circle('S', 1003, 40, 80);

/// Draw all shapes. The function uses a for loop to display the circles and sprays in arrCircle.

drawAll(arrCircle, SIZE);

/// Delete all shapes

deleteAll(arrCircle, SIZE);

return 0;

}

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

=+ What is the future direction of competition?

Answered: 1 week ago