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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started