Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions

Question

Evaluate the integral. dx

Answered: 1 week ago

Question

=+b) Is this model appropriate for this series? Explain.

Answered: 1 week ago