Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Standard Requirements: 1. Include the standard multi-line comment at the start of your program code. Pseudocode IS REQUIRED for the Exam. Include a well-written (not

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
Standard Requirements: 1. Include the standard multi-line comment at the start of your program code. Pseudocode IS REQUIRED for the Exam. Include a well-written (not too short) program description. Make sure to include comments throughout the body of your program. Programs must be compiled and executed. This is the only way to check ifyour program works and it does what it was designed to do. If program does not compile, it most likely has some sort of logical or syntax errors. This an opportunity to Wrbl-L'IV' clean it up and make sure that it is functional. Exam 2 - The following are the details and instructions for the exam: Create a menu-driven application that takes the radius ofa circle as input and returns either the area, circumference, or diameter of a circle. To begin, make sure to declare n:(P|) as a global variable (before the main function) and initialize it with 3.14159. Make sure data is validated where needed. This application should use the following functions (make sure to use function prototypes before the main): displayMenu - should display the following menu items: 1. Get Radius 2. Calculate Area 3. Calculate Circumference 4. Calculate Diameter 5. Exit Input: none Output: void getChoice - This function should ask the user for a choice between 1 and 5 and store it in a reference parameter variable. Validate your cholce...on/lntegers 1 - 5 should be entered. Input: User inputs the choice which gets stored in an integer data type reference parameter (choice). Output/Data returned: none since the choice is passed by reference. This is a void type of function. getRadius - This function should ask the user for a radius and store it in a reference parameter variable. Do not allow a negative radius (data validation...hint...hlnt). Input: User inputs the radius which gets stored in a double data type reference parameter (radius). Output/Data returned: none since radius is passed by reference. This is a void type of function. cachrea - should calculate and return the area of a circle. This function should be called by main function and should be passed radius as an argument. Formula to use: Area = zrz ----> make sure this formula is a C++ expression. I'll give you this one: Area = P! * radius * radius. Input/Data received: radius Output/Data returned: area of the circle calcCircumference - should calculate and return the circumference ofa circle. This function should be called by main function and should be passed radius as an argument. Formula to use: Circumference = er----> make sure this formula is a C++ expression. Input/Data received: radius Output/Data returned: circumference of the circle cachiameter - should calculate and return the diameter ofa circle. This function should be called by main and should be passed radius as an argument. Formula to use: Diameter= 2r ----> make sure this formula is a C++ expression. Input/Data received: radius Output/Data returned: diameter of the circle int main() using a do..while loop, the main should 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 to call the appropriate function - Get radius from user ' Calculate and display the area - Calculate and display circumference - Calculate and display diameter - Exit application 6. Pause screen 7. Clear screen 8. As long as the user has not chosen option 5, then repeat all above steps

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

=+What new things would you have to do?

Answered: 1 week ago

Question

Discuss the techniques of sales forecasting.

Answered: 1 week ago

Question

Write short notes on Marketing mix.

Answered: 1 week ago