Question: Given an integer n as an input, decides the geometrical figure for which the area has to be calculated, e.g. n = 1 for circle,

Given an integer n as an input, decides the geometrical figure for which the area has to be calculated, e.g. n = 1 for circle, n = 2 for rectangle, and n = 3 for triangle. Calculate and display the area of the respective figure. Input: In[]: 1 5 where: First line represents the value of n , which represents the choice of the shape selected. Second line represents the dimension required by the chosen figure, here it is circle so only radius of circle is required. Output: Out[]: 78.500000 Explanation: Output displays the area of the chosen geometrical figure. Note: There are 3 available figures, that are circle, rectangle and triangle.

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!