Question: 1) a) Design a program in C++ that models inflating a spherical balloon. First the balloon is inflated to have a certain diameter (which is

1)

a) Design a program in C++ that models inflating a spherical balloon. First the balloon is inflated to have a certain diameter (which is provided as an input). Then inflate the balloon so that the diameter grows by an inch, and display the amount the volume has grown. Repeat that step: grow the diameter by another inch and show the growth of the volume. Hint: The volume of a sphere is 43 r3

Assuming that the input is 10, the two outputs, when rounded to the nearest integer will be 173 and 208

b) Rearrange the following lines of code to produce correct pseudocode for this task:

growth = volume2 - volume1

volume2 = diameter diameter diameter / 6

Print growth

volume3 = diameter diameter diameter / 6

volume1 = diameter diameter diameter / 6

growth = volume3 - volume2

Prompt for diameter and read user input

Print growth

diameter++

diameter++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!