Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Write a function float computeArea (int *v1, int *v2, int shape) that computes the area of four basic geometric entities. The geometric entity will

C++

Write a function float computeArea (int *v1, int *v2, int shape) that computes the area of four basic geometric entities. The geometric entity will be identified by the argument shape which is 1 for triangle, 2 for square/rectangle and 3 for circle. The arguments v1 and v2 are pointers to the two arguments defining the shape. For circle v1 is a pointer to the diameter of the circle, v2 is null, for rectangle/square, v1 and v2 are pointers to the height and width for triangle v1 is a pointer to the the base and v2 points to the height of the triangle.

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

If you were Rob Whittier, how would you resolve this dispute?

Answered: 1 week ago