Question
Write a program that computes buoyant force given the radius and weight of a sphere. Buoyant Force = Volume x Water Weight (62.4 lbs/cubic foot).
Write a program that computes buoyant force given the radius and weight of a sphere. Buoyant Force = Volume x Water Weight (62.4 lbs/cubic foot). Your program should decide whether a sphere sinks or floats in water. The user inputs the radius of the sphere and the weight. Volume = 4/3 pi r^3. Use const double PI = 3.141592; for PI.
Your program must prompt for multiple calculations.
Example Output:
This program computes Buoyant Force in water given sphere radius.
Based on the weight of the sphere, it determines whether the sphere floats or sinks.
Enter the radius of the sphere.
1
You entered 1
Enter the weight of the sphere.
1
You entered 1
Buoyant Force = 261.38
Egads, it floats!
Recalculate? (1 = yes, 0 = exit)
1
Enter the radius of the sphere.
1
You entered 1
Enter the weight of the sphere.
400
You entered 400
Buoyant Force = 261.38
It sunk...
Recalculate? (1 = yes, 0 = exit)
0
Press any key to continue . . .
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started