Problem Statement: Write, compile, and execute a C++
program to calculate the volume of a dumbbell that
consists of 2 spheres, each being attached to each end
of a cylindrical bar. Your program should ask the user
to provide the radius of the sphere, the radius of the
bar and the length of the bar. The program should
display the resulting volume formatted to 3 decimal places.
a) Determine the inputs and outputs.
b) Develop a solution by providing a mathematical equation that relates the
various inputs to the output
c) Write an algorithm to solve the problem
d) Carry out a hand calculation to determine the volume of a dumbbell that has rs
= 5.0, rbar = 1.0 and lbar = 12.0. Use 3.1415926 as the value of π
program to calculate the volume of a dumbbell that
consists of 2 spheres, each being attached to each end
of a cylindrical bar. Your program should ask the user
to provide the radius of the sphere, the radius of the
bar and the length of the bar. The program should
display the resulting volume formatted to 3 decimal places.
a) Determine the inputs and outputs.
b) Develop a solution by providing a mathematical equation that relates the
various inputs to the output
c) Write an algorithm to solve the problem
d) Carry out a hand calculation to determine the volume of a dumbbell that has rs
= 5.0, rbar = 1.0 and lbar = 12.0. Use 3.1415926 as the value of π
Comment