Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use c++ program with cout cin command use 1d array 2d array and function example Write a program to calculate area of common geometric shapes
use c++ program with cout cin command
use 1d array 2d array and function
example
Write a program to calculate area of common geometric shapes shown in Figure 1. The program should give the user the option to choose from rectangle, circle, or triangle. Create functions representing each geometric shape which calculates and refer (pass by reference) the value of the area. Add another function to find the smallest and largest area of calculated geometric shapes. The program should also allow the user to repeat the whole process all over again. The sample output is given as in Figure 2. Rectangle Circle A = ab A= r2 TE Triangle A = ah/2 calculate or find in area of 1 Rectangle 2 - Circle 3 - Triangle Show smallest and largest area Your selection: b wrong selection! Do you want to repeat the whole process (Y/N): y Calculate or find min-max area of: Rectangle 2 - Circle 3 - Triangle Show smallest and largest area Your selection: 4 o largest No smallest Do you want to repeat the whole process (Y/N): y Calculate or find minix area of: 1 Rectangle 2 Circle 3 - Triangle 4 - Show sellest and largest area Your selection 1 a: 1 b: 1 Area of a rectangle: 1 Do you want to repeat the whole process (Y/N): Y Calculate or find in ax area of: Rectangle 2 - Circle 3 - Triangle Show smallest and largest area Your selection: 2 Area of a circle: 12.568 Do you want to repeat the whole process (Y/N): Y Calculate or find min-max area of: Rectangle 2 Circle 3 - Triangle 4 - Show sellest and largest area Your selection: 3 hi 3 Area of a triangle: 4.5 Do you want to repeat the whole process (Y/N): y Calculate or find in ax area of: 1 - Rectangle 2 - Circle 3 - Triangle Show smallest and largest area Your selection: 4 Largest area is 12.568 of geometric shape Circle Sallest area is 1 of geometric shape Rectangle Do you want to repeat the whole process (Y/N): Process excited after 31.03 seconds with return value @ press any key to continueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started