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
Get step-by-step solutions from verified subject matter experts
