Given the height of a cylindrical water tank


Given the height of a cylindrical water tank with a hemispherical (half sphere) cap on each end (both caps with the same radius) and a specified height of the water in the tank determine the volume of the water

.Challenge of this problem: Determining how to "select" the correct volume calculation based on the input (without using
selection)

Example Execution #1:
Enter the height of the tank: 10
Enter the radius of the tank: 2
Enter the height of the water: 1
Volume of Water: 5.2360
Example Execution #2:
Enter the height of the tank: 10
Enter the radius of the tank: 2
Enter the height of the water: 2
Volume of Water: 16.7552
Example Execution #3:
Enter the height of the tank: 10
Enter the radius of the tank: 2
Enter the height of the water: 8
Volume of Water: 92.1534
Example Execution #4:
Enter the height of the tank: 10
Enter the radius of the tank: 2
Enter the height of the water: 9
Volume of Water: 103.6726
Example Execution #5:
Enter the height of the tank: 10
Enter the radius of the tank: 2
Enter the height of the water: 5
Volume of Water: 54.4543
Example Execution #6:
Enter the height of the tank: 10
Enter the radius of the tank: 5
Enter the height of the water: 10
Volume of Water: 523.5988

Assignment Requirements:
• No SELECTION is permitted for this assignment!
? This includes but is not limited to: if/else if/else, switch, conditional expressions, bool variables, logical and relational operators
• Only non-negative integer values will be entered.
• Only reasonable (expected) data will be entered. The radius must be greater than zero. 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Given the height of a cylindrical water tank
Reference No:- TGS0105783

Expected delivery within 24 Hours