Question

In: Computer Science

BUOYANCY Buoyancy is the ability of an object to float. Archimede's Principle states that the buoyant...

BUOYANCY

Buoyancy is the ability of an object to float. Archimede's Principle states that the buoyant force is equal to the weight of the fluid that is displaced by the submerged object. The buoyant force can be computed by:

buoyant force = (object volume) times (specific gravity of the fluid)

If the buoyant force is greater than or equal to the weight of the object then it will float, otherwise it will sink.

Write a program that inputs the weight (in pounds) and radius (in feet) of a sphere and outputs whether the sphere will sink or float in water. Use 62.4 lb/cubic foot as the specific weight of water. The volume of a sphere is computed by (4/3)π times the radius cubed.

INPUT and PROMPTS. The program uses this prompt ""Input weight of the sphere in pounds." for the first number it reads in, the weight of the sphere. The program uses this prompt "Input radius of the sphere in feet." for the second number it reads in, the radius of the sphere. Do not print out these numbers as they are read in

OUTPUT. The program either prints out "The sphere will float in water." or "The sphere will sink in water.".

Solutions

Expert Solution

//Assuming c++ language do comment if any other language needed

// do comment if any problem arises

//code

#include <iostream>

using namespace std;

//specific gravity of water

const float specific_gravity = 62.4;

const float pi = 3.14;

int main()

{

float weight, radius;

//read weight of sphere

cout << "Input weight of the sphere in pounds: ";

cin >> weight;

//read radius of sphere

cout << "Input radius of the sphere in feet: ";

cin >> radius;

//calculate volume of sphere

float volume = (4 / 3) * pi * radius * radius * radius;

//calculate Byouancy

float Buoyancy = volume * specific_gravity;

//if buoyancy is greater than or equal to specific gravity

if (Buoyancy >= weight)

cout << "The sphere will float in water.";

else

cout << "The sphere will sink in water.";

}

Output:


Related Solutions

Babinet’s principle states (roughly) that the diffraction pattern produced by a solid object is the same...
Babinet’s principle states (roughly) that the diffraction pattern produced by a solid object is the same as the diffraction pattern that would be produced by a hole of the same shape as the object.Can you think of a way in which you could measure the width of a strand of hair using this principle and possibly using interference and diffraction
13) Determine the buoyant force, in N, of water on a completely submerged object having a...
13) Determine the buoyant force, in N, of water on a completely submerged object having a volume of 3.40 m3. a) 4.53 x 104 b) 3.33 x 104 c) 8.39 x 104 d) 1.45 x 104 Answer_______________ 14) A 10,000-kg railroad car traveling at a speed of 2.0 m/s strikes an identical car at rest. The cars lock together as a result of the collision. Determine the velocity, in m/s, of the locked cars after the collision. a) 1 b)...
Research about one of this topic in 10 paper Buoyancy and Archimedes’ Principle Bernoulli’s Equation Simple...
Research about one of this topic in 10 paper Buoyancy and Archimedes’ Principle Bernoulli’s Equation Simple Harmonic Motion Characteristics of Sound Doppler
(Please answer all questions) 1.)The Buoyant Force from a fluid to an object depends on which...
(Please answer all questions) 1.)The Buoyant Force from a fluid to an object depends on which of the following factors? a.)The volume of the object b.)The volume of the fluid c.)The density of the fluid d.)The density of the object 2.)Why did the Titanic sink after it hit an iceberg and water rushed into the hull through the hole created by the collision? a.)The density of water has increased b.)The density of the boat increased c.)The mass of the boat...
A state diagram shows the states of an object and the transitions between states •States are...
A state diagram shows the states of an object and the transitions between states •States are particularly common with objects that interact with the program user. •Suppose that a user wants to retrieve recent voice mail messages. •Some part of the voice mail system must keep track of the current state so that it can process the user input correctly Java. I need a state diagram for the following code: What the code Does: adds a new regular task, delete...
How does the ability-to-pay principle of taxation differ from the benefit principle? What problems are encountered...
How does the ability-to-pay principle of taxation differ from the benefit principle? What problems are encountered in implementing both of these tax philosophies? Does a Christian worldview support one philosophy over the other? Support your response with a discussion of specific scripture.
How is the ability to store glucose as glycogen related to the general principle of physiology...
How is the ability to store glucose as glycogen related to the general principle of physiology that physiological processes require the transfer and balance of matter and energy?
Please give comments, thank you. In economics, the principle of absolute advantage refers to the ability...
Please give comments, thank you. In economics, the principle of absolute advantage refers to the ability of a party to produce a greater quantity of a good, product, or service than competitors, using the same amount of resources, and The law or principle of comparative advantage holds that under free trade, an agent will produce more of and consume less of a good for which they have a comparative advantage. The more good and services that a country can product...
(a) A fundamental law of motion states that the acceleration of an object is directly proportional...
(a) A fundamental law of motion states that the acceleration of an object is directly proportional to the resultant force exerted on the object and inversely proportional to its mass. If the proportionality constant is defined to have no dimensions, determine the dimensions of force. (Use the following as necessary: M, L, and T.) (b) The newton is the SI unit of force. According to the results for (a), how can you express a force having units of newtons using...
10. Newton’s law of cooling states that the temperature of an object changes at a rate...
10. Newton’s law of cooling states that the temperature of an object changes at a rate proportional to the difference between the temperature of the object an the temperature of its surroundings. (a) Write a differential equation for the temperature of the object at any time. b) State the dimensions of the constant of proportionality, and its SI units. C) Plot the direction field for the DE and find the limiting behaviour of solutions. If this limit depends on the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT