Write a C++ program that displays the following menu: Area calculator 1- Calculate the area of a circle 2- Calculate the area of a rectangle 3- Calculate the area of a triangle 4- Quit Enter your...


with function


Write a C++ program that displays the following menu:<br>Area calculator<br>1- Calculate the area of a circle<br>2- Calculate the area of a rectangle<br>3- Calculate the area of a triangle<br>4- Quit<br>Enter your choice (1- 4):<br>Based on the user choice, the program should do the following:<br>• Call a user-defined function that prompts the user for the relevant parameters.<br>• Then it does the calculation and returns the area selected.<br>• The main program should then display the area returned by the function.<br>• Note: the program should contain one function only called area in addition to the main function.<br>For example, if the user enters 1, the program should ask the user for the radius of the<br>circle, call a function that calculates the area of the circle given the value of the radius, and then the main program should display the circle<br>area.<br>Area of Circle<br>A= pi*r*r<br>Area of Rectangle<br>A=I*w<br>Area of Triangle<br>A=(b*h)/2<br>

Extracted text: Write a C++ program that displays the following menu: Area calculator 1- Calculate the area of a circle 2- Calculate the area of a rectangle 3- Calculate the area of a triangle 4- Quit Enter your choice (1- 4): Based on the user choice, the program should do the following: • Call a user-defined function that prompts the user for the relevant parameters. • Then it does the calculation and returns the area selected. • The main program should then display the area returned by the function. • Note: the program should contain one function only called area in addition to the main function. For example, if the user enters 1, the program should ask the user for the radius of the circle, call a function that calculates the area of the circle given the value of the radius, and then the main program should display the circle area. Area of Circle A= pi*r*r Area of Rectangle A=I*w Area of Triangle A=(b*h)/2

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here