Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB Help. Can someone please help me solve this whole question. Thanks so much! Question is HW5P3 (20 points) Cuboid Cylinder Sphere A 4m The

MATLAB Help. Can someone please help me solve this whole question. Thanks so much! Question is image text in transcribed

HW5P3 (20 points) Cuboid Cylinder Sphere A 4m The formulas for determining the area and volume of three 3D shapes, 1. Cuboid, 2. Cylinder and 3. Sphere, are shown in the table and figure above. Write a script HW5P3 that, i. (1 pt) displays a list of the 3D shapes and their numbers, ii. (1 pt) prompts the user to select a number 1 to 4, from the previously displayed list, ii. (5 pts) based on the user's selection, the program then asks the user to enter the required dimensions for determining the area and volume of the shape selected. For example, (the radius only for the sphere, the base radius and height for a cone, etc.). (6 pts) The program then determines the area and volume of that specific shape from the formulas given above and prints these values in the following format: iv. for a cylinder as an example, the program prints, "For a cylinder of XX in radius and XX in height, the surface area-XX in^2 and the volume = XX in^3." xx is the number of each dimension with 2 decimals. Similar text must be printed for every shape based on the name of the shape and its dimensions. (All dimensions are assumed to be in inches). (3 pts) If the user enters an invalid choice, the script simply prints an error message. For example, if the user entered a number of shape that is not in the list or entered an invalid negative dimension, the script must print "Invalid Entry, please check your inputs and try again." v. Your script may combine between switch-case and if-else structures

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 Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions