Question: A company manufactures regular hexagonal prisms and prides itself on being within a tight tolerance and having high precision. The volume of a hexagonal prism
A company manufactures regular hexagonal prisms and prides itself on being within a tight tolerance and having high precision. The volume of a hexagonal prism is given by:
Your solution must include the following:
Use the rand function to create a vector of of random values within the range This will represent the dataset of base edge values
Note: to learn how to use the rand function, type help rand into the Command Window
Use the rand function to create a vector of random values within the range This will represent the dataset of height values
Solve for the volume of each hexagonal prism using the given equation
You should end up with a vector of values of volume, and this output should be suppressed
This can be done either using elementbyelement operations OR a forloop
Neatly display the base edge length, height, and volume information for each hexagonal. Refer to the sample output below for how your output should be formatted.
This will require a forloop
Generate a random integer between using the randi function. This will reference a character in the ASCII table, which is attached at the end of this document.
Set up a decision structure as follows:
If the random integerASCII value would indicate an UPPERCASE letter
Find and neatly display to the user the hexagonal prisms with the smallest and largest BASE EDGE
Refer to the sample output below to see how your output should be formatted
If the random integerASCII value would indicate a SPECIAL CHARACTER or NUMBER
Find and neatly display to the user the hexagonal prisms with the smallest and largest VOLUME
If the random integerASCII value would indicate a LOWERCASE letter
Find and neatly display to the user the hexagonal prisms with the smallest and largest HEIGHT
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
