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