Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1) Please write an algorithm that will read the heightof a cylinder and radius of its base and print its volume andsurface area. The

Question 1) Please write an algorithm that will read the heightof a cylinder and radius of its base and print its volume andsurface area.

The volume of the cylinder is computed as h r2 ? (h=height,r=radius).

The surface area of the cylinder is 2?rh + 2?r2 (h=height,r=radius).

Question 2) Write a C-program that implements the algorithm inquestion 1. You should prompt the user to enter the height andradius and then compute and print the volume and surface area ofthe cylinder.

Sample run:

Please enter the height of the cylinder: 90

Please enter the radius of the base: 5

The volume of the cylinder is: 549.78

The surface area of the cylinder is: 376.99

Question 3) Write a C-program to compute the volume and surfacearea of N cylinders. Your program should read the height and radiusuntil the value –1 of the height is entered. The program shouldprint the volume and surface area of each entered cylinder.

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

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions

Question

6-2 Explain what is meant by reliability and validity.

Answered: 1 week ago