Question: You are to write a program which will answer a pair of questions for squares, triangles, circles and ellipses. A square is defined by its

You are to write a program which will answer a pair of questions for squares, triangles, circles and ellipses. A square is defined by its lower left corner You are to write a program which will answer a , and the length of one side You are to write a program which will answer a . An isosceles triangle is defined by the topmost point You are to write a program which will answer a , its height You are to write a program which will answer a , and its base You are to write a program which will answer a . A circle is defined by its center You are to write a program which will answer a and its radius You are to write a program which will answer a . An ellipse is defined by its center You are to write a program which will answer a , its vertical height You are to write a program which will answer a and its horizontal width You are to write a program which will answer a . The square, circle, ellipse, and triangle are oriented as follows with respect to the You are to write a program which will answer a and You are to write a program which will answer a coordinate axes.

You are to write a program which will answer a

Note: Shapes may be positioned anywhere in the 2-D Cartesian plane; the illustration is meant to convey orientation with respect to the axes (i.e. "rotation angle") only; no position information is implied.

The first question involves area. Write functions squareArea, triangleArea, circleArea and ellipseArea which will compute areas from the information describing the object.

The second question involves the notion of inside. Write four functions insideSquare, insideTriangle, insideCircle and insideEllipse which will take the same information describing the object as well as a coordinate pair You are to write a program which will answer a . These functions should determine whether or not You are to write a program which will answer a lies inside the object, and return the boolean values true or false according to the result. Display these results as well. You may assume that the triangle is isosceles (but not necessarily equilateral). You may also assume that a point which lies exactly on the edge of an object should be considered "inside" the object.

Write function main to prompt the user for the information for one of each object and pass it to the area and "inside" functions; the returned results should then be displayed in a pleasing format for the user. Note that none of the functions outlined above is to do any input/output - you may do the necessary I/O in main(), or you could create additional "helper" functions to perform these steps. The functions outlined above should be written to be as generally useful as possible (this will be part of the grading considerations). Although not required by this assignment, any additional functions you create would help to demonstrate your grasp of the concepts of top-down design and modular coding.

Please give answer in C++ language.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!