Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in C++ Write a program to calculate area of common geometric shapes shown in Figure 1. The program should give the user the option to

image text in transcribedimage text in transcribedimage text in transcribed

in C++

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=ar2 Triangle A = ah/2 Figure 1: Common geometric shapes C:\Users\FAID\Desktop\Teaching and Learning\Session 2020_2021 Sem 1\Computer Programming (BITG 1233) 07. Assignment Questi... Calculate or find min-max area of: 1 Rectangle 2 - Circle 3 Triangle 4 - 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: 1 - Rectangle 2 - Circle 3 - Triangle 4 - Show smallest and largest area Your selection: 4 No largest No smallest Do you want to repeat the whole process (Y/N): y Calculate or find min-max area of: 1 Rectangle 2 - Circle 3 - Triangle 4 - Show smallest 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 min-max area of: 1 Rectangle 2 - Circle 3 - Triangle 4 - Show smallest and largest area Your selection: 2 r: 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: 1 - Rectangle 2 - Circle 3 - Triangle 4 - Show smallest and largest area Your selection: 3 a: 3 h: 3 Area of a triangle: 4.5 Do you want to repeat the whole process (Y/N): Y Calculate or find min-max area of: 1 - Rectangle 2 - Circle 3 - Triangle 4 - Show smallest and largest area Your selection: 4 Largest area is 12.568 of geometric shape Circle Smallest area is 1 of geometric shape Rectangle Do you want to repeat the whole process (Y/N): n Process exited after 31.03 seconds with return value o Press any key to continue

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

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions

Question

4. Explain the strengths and weaknesses of each approach.

Answered: 1 week ago