Question: For each case do the following: a . Ask the user for the parameter ( s ) you need. e . g . for area
For each case do the following:
a Ask the user for the parameters you need. eg for area of square you only need the
side. Other areas and volumes you will need the variables to solve for area or volume
b Call a function to solve for the area or a different function for the volume of the object
selected by the user. Note the call to a function will be in the form:
Variable "nameoffunction" parameter list ; Parameter list is the items values in
above. The parameter values need to be the items necessary to calculate area or
volume respectively.
c Use fprintf to output the answer eg Area or Volume of the specific object.
Each function will have output variable, and inputs based on the data needed to compute the
area of the crosssectional shape ie circle, triangle, or parallelogram. In the volume functions
you need to add the height plus parameters for the area.
EXTRA CREDIT
pts for using listdialog for the six case selections. See Listdailog.m file in Canvas to see the code.
pts for using your area functions in the volume functions. For volume you need area times ht
therefore if you ask for the correct input parameters, instead of recalculating the area just call the area
function then multiply the area times ht and return the volume. You will then call a function from a
function.
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
