Question: Write a function that will compute the volume and surface area of a rectangular prism when provided with the object's 3 numerical dimensions. In other

 Write a function that will compute the volume and surface area

Write a function that will compute the volume and surface area of a rectangular prism when provided with the object's 3 numerical dimensions. In other words, the function should be given three inputs (height, width and depth) and return two outputs (the volume and surface area, in that order). Show the following test cases 1. a. height: 5 width:3 depth: 2 b. heignt:1 width:8 depth:4 c. height: 2 width:2 depth:10 The script should call the function 3 times and store the results of the three test cases in two row vectors called vol and sa. Function specifications: Input arguments: length, width, height all scalars. (Order does not matter) Output arguments: volume, area - both scalars. (Must be in this order) OPTIONAL: If you prefer, you can write the function such that the input and output arguments are arrays; in that case, only one call to the function is necessary

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!