Question: Write a MATLAB script file for determining the area of rectangles ( Ar ) , triangles ( At ) and circles ( Ac ) Ar
Write a MATLAB script file for determining the area of rectangles Ar triangles At and circles Ac
Ar bh
At
bh
Ac r
a The code should start by using a menu command to ask the user whether the shapes is a rectangle,
triangle or a circle. Depending on the chosen shape, it will use a conditional selection of ifthen or
switchcase and a function input to get the dimensions b h and r from the user.
b Through the same conditional selection, the computed area is displayed on screen using fprintf
with three decimal places.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
