Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in C++, use return, if/else statements, etc. Beginner/Intermediate C++ knowledge Write a program to calculate the area of several basic geometric shapes. The program

Code in C++, use return, if/else statements, etc. Beginner/Intermediate C++ knowledge image text in transcribed
Write a program to calculate the area of several basic geometric shapes. The program first asks the user for a shape(C Circle, R -Rectangle, S Square, and T Triangle). The program then calls one of four user defined functions to calculate the area of the shape and return the answer to the main for printing to the screen. Depending on the shape, the corresponding function's argument(s) is (are) the necessary parameter(s) for area calculation. Therefore, the main should receive the value(s of the parameter(s) from the user before calling any function. The following is a list of parameters for each shape and the expression for its area calculation Shape Circle (C) Square (S) Rectangle (R Radius Side Height Area-3.14159(Radius Area (Side) Area-Width(Height) Width Triangle (T Base Height Area 0.5 (Base)(Height) You must test your program for all shapes. The program should reject request for any other shapes; this option must be tested as well

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

LO4 Provide an overview of four challenges facing HR today.

Answered: 1 week ago