Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Chapter 2 Write a program that computes buoyant force given the radius and weight of a sphere. Buoyant Force = Volume x Water Weight (62.4

Chapter 2

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

What is the client acceptance and continuance process?

Answered: 1 week ago

Question

Identify three personal human relations goals for the course.

Answered: 1 week ago