Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a MATLAB script cup.m that will calculate the volume and surface area of a paper cup shaped as a frustum of cone. a) Request

Write a MATLAB script cup.m that will calculate the volume and surface area of a paper cup shaped as a frustum of cone. a) Request (by input) a vector that has two radii [R1 R2] of the cup from keyboard and name it r. b) Request the height of the cup from keyboard and name it h. c) Request for the calculation option either volume by typing 1 or surface area by typing 2. Any other number will end the program. Name the option as op. Calculate volume of the cup and the surface area of the paper by:

v=(1/3)pi*h*(R1^2+R2^2+R1*R2) s=pi*(R1+R2)*sqrt((R2-R1)^2+h^2) + pi*R1^2

and print the formatted output (use fprintf) similar to the following example: Bottom radius = x.x cm, top radius = x.x cm and height = xx.x cm volume is xxx.xx cm^3 or surface area is xxx.xx cm^2

d) Do 3 test runs with r = [3.0 3.8 ] cm and h = 9.5 cm, and options op = 1, 2 and 5

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_2

Step: 3

blur-text-image_3

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 Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions