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 nonbold 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 radius
c Compare two existing circles radiuses
x Exit
Enter command: vDiameter: Circumference: Area:
Circle :
Radius:
Diameter:
Circumference:
Area:
Enter command: a
Capacity limit has been reached! Creating more heap memory for the array...
More space has been allocated! Continuing program...
Circle with a radius of
Circle with a radius of
Select the circle for the left side of the addition:
Select the circle for the right side of the
addition:
The new circle has been added successfully...
Enter command: s
Circle with a radius of
Circle with a radius of
Circle with a radius of
Select the circle for the left side of the subtraction:
Select the circle for the right side of the subtraction:
The new circle has been added successfully...
Enter command: i
Circle with a radius of
Circle with a radius of
Circle with a radius of
Circle with a radius of
Select the circle to increment by radius:
The selected circle has incremented its radius successfully...Enter command:
Circle with a radius of
Circle with a radius of
Circle with a radius of
Select the circle for the left side of the subtraction:
Select the circle for the right side of the subtraction:
The new circle has been added successfully...
Enter command: i
Circle with a radius of
Circle with a radius of
Circle with a radius of
Circle with a radius of
Select the circle to increment by radius:
The selected circle has incremented its radius successfully...
Enter command:
Capacity limit has been reached! Creating more heap memory for the array...
More space has been allocated! Continuing program...
Circle with a radius of
Circle with a radius of
Circle with a radius of
Circle with a radius of
Select the circle for the left side of the subtraction:
Select the circle for the right side of the subtraction:
The new circle has been added successfully...
Enter command: C
Circle with a radius of
Circle with a radius of
Circle with a radius of
Circle with a radius of
Circle with a radius of
Select the circle for the left side of the comparison:
Select the circle for the right side of the
comparison:
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 circlecount 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
The function getcirclecount will be the getter for the private circlecount.
The function incrementcount will be used to increment the count of the private circlecount. 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 getdiameter will return the diameter of the circle. The formula is the following: diameter radius
The function getcircumference will return the circumference of the circle. The formula is the following: circumference diameter
The function getarea 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
Store two initial circles on the dynamic array with the following values:
Circle : radius
Circle : 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
