Question: 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

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!