Create a (Mid level C++ program) menu-driven application that takes the radius of a circle as input and returns either t

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Create a (Mid level C++ program) menu-driven application that takes the radius of a circle as input and returns either t

Post by answerhappygod »

Create a (Mid level C++ program) menu-driven application thattakes the radius of a circle as input and returns either the area,circumference, diameter, or a table of circumference values. Tobegin, make sure to declare πœ‹ as a global variable and initializeit with 3.14159. This application should use the followingfunctions:
displayMenu - should display the following menuitems:
Input: none
Output: void
__________________________________________________________________
getChoice - should ask the user for a choicebetween 1 and 5 and store it in a reference parameter variable.
Input: integer for choice
Output: none since the choice is passed byreference
________________________________________________________________________
getRadius - should ask the user for a radiusand store it in a reference parameter variable. Do not allow anegative radius.
Input: double for radius
Output: none since radius is passed byreference
__________________________________________________________________________
calcArea - should calculate and return the areaof a circle. This function should be called by main and should bepassed radius as an argument. 𝐴 = πœ‹π‘Ÿ 2
Input: radius
Output: area of the circle
_____________________________________________________________________________
calcCircumference - should calculate and returnthe circumference of a circle. This function should be called bymain and should be passed radius as an argument. 𝐢 = 2πœ‹π‘Ÿ
Input: radius
Output: circumference of the circle
_________________________________________________________________________________
calcDiameter - should calculate and return thediameter of a circle. This function should be called by main andshould be passed radius as an argument. 𝐷 = 2π‘Ÿ
Input: radius
Output: diameter
______________________________________________________________________________________
int main() using a do..while loop, the mainshould do the following:
1. Declare all appropriate local variables
2. Display Menu
3. Get a choice from the user
4. Clear screen
5. Based on the user’s choice, use an if statement or switch tocall the appropriate function
6. Pause screen
7. Clear screen
8. As long as the user has not chosen option 5, then repeat allabove steps.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply