Question
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
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