Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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