Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions