Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

9. Understand the phenomenon of code switching and interlanguage.

Answered: 1 week ago