Question: Circle Tester Create a Circle Tester that uses static variables and functions, along with overloaded operators. Note: Bold words are output while non - bold

Circle Tester
Create a Circle Tester that uses static variables and functions, along with overloaded operators.
Note: Bold words are output while non-bold words are input.
Console Example
Circle Tester
COMMAND MENU
v - View all circles info
a - Add a new circle by adding two existing circles together
s - Add a new circle by subtracting two existing
circles together
i - Increment an existing circle by 5 radius
c - Compare two existing circles radiuses
x - Exit
Enter command: vDiameter: 10Circumference: 31.4159Area: 78.5397
Circle 2:
Radius: 10
Diameter: 20
Circumference: 62.8318
Area: 314.159
Enter command: a
Capacity limit has been reached! Creating more heap memory for the array...
More space has been allocated! Continuing program...
1- Circle 1 with a radius of 5
2- Circle 2 with a radius of 10
Select the circle for the left side of the addition:
2
Select the circle for the right side of the
addition: 1
The new circle has been added successfully...
Enter command: s
1- Circle 1 with a radius of 5
2- Circle 2 with a radius of 10
3- Circle 3 with a radius of 15
Select the circle for the left side of the subtraction: 3
Select the circle for the right side of the subtraction: 1
The new circle has been added successfully...
Enter command: i
1- Circle 1 with a radius of 5
2- Circle 2 with a radius of 10
3- Circle 3 with a radius of 15
4- Circle 4 with a radius of 10
Select the circle to increment by 5 radius: 3
The selected circle has incremented its radius successfully...Enter command: s
1- Circle 1 with a radius of 5
2- Circle 2 with a radius of 10
3- Circle 3 with a radius of 15
Select the circle for the left side of the subtraction: 3
Select the circle for the right side of the subtraction: 1
The new circle has been added successfully...
Enter command: i
1- Circle 1 with a radius of 5
2- Circle 2 with a radius of 10
3- Circle 3 with a radius of 15
4- Circle 4 with a radius of 10
Select the circle to increment by 5 radius: 3
The selected circle has incremented its radius successfully...
Enter command: s
Capacity limit has been reached! Creating more heap memory for the array...
More space has been allocated! Continuing program...
1- Circle 1 with a radius of 5
2- Circle 2 with a radius of 10
3- Circle 3 with a radius of 20
4- Circle 4 with a radius of 10
Select the circle for the left side of the subtraction: 4
Select the circle for the right side of the subtraction: 1
The new circle has been added successfully...
Enter command: C
1- Circle 1 with a radius of 5
2- Circle 2 with a radius of 10
3- Circle 3 with a radius of 20
4- Circle 4 with a radius of 10
5- Circle 5 with a radius of 5
Select the circle for the left side of the comparison: 4
Select the circle for the right side of the
comparison: 5
First circle has larger radius than the second circle!
Enter command: x
Deleting allocated memory for dynamic array...
Bye!Specimcations
-Utilize the UML diagram provided to create the Circle class. Regarding some of the members of the class:
The private variable circle_count will be declared as static, and will be used to count how many circles are stored in a dynamic array in the main function.
Create a Circle constructor that will use a radius parameter in order to set the initial radius of the circle. Declare the parameter with a default value of 0.
The function get_circle_count() will be the getter for the private circle_count.
The function increment_count() will be used to increment the count of the private circle_count. You will need to call this function every time a new circle is added in the dynamic array.
The function get radius() will be the getter for the private radius variable.
The function get_diameter() will return the diameter of the circle. The formula is the following: diameter =2* radius
The function get_circumference() will return the circumference of the circle. The formula is the following: circumference =* diameter
The function get_area() will return the area of the circle. The formula is the following: area =* radius * radius
Create the six requested overloaded operators. You will need them later in order to do different operations on the circles depending on the user command input.
At the start of your main function, you will need to declare a dynamic array to store all the circles throughout the program. Declare it with an initial capacity of 2.
Store two initial circles on the dynamic array with the following values:
-Circle 1: 5 radius
Circle 2: 10 radius
If the maximum capacity of the array is reached, perform all the necessary steps to extend its capacity. Double its capacity every time you need to do this Also, make sure to let the user know of this by displaying an appropriate message to the screen (see console example for reference).
When the user enters 'v
Circle Tester Create a Circle Tester that uses

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 Programming Questions!