Buoyancy is the ability of an subject to float. Archimedes\' principle states th
ID: 3779053 • Letter: B
Question
Buoyancy is the ability of an subject to float. Archimedes' principle states that the buoyant forces is equal to the weight of the fluid that is displaced by the submerged object. The buoyant force can be computed by Fb = v times y where Fb is the buoyant force, v is the volume of the submerged object, and y is the specific weight of the fluid. If Fb 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 y = 62.4 lb/cubic feet as the specific weight of water. The volume of a sphere is computed by (4/3)n(r cubed).Explanation / Answer
#include <iostream>
using namespace std;
int main()
{
double w,r;
cout<<"Enter the weight of the object:";
cin>>w;
cout<<"Enter the radius of the object:";
cin>>r;
double v = (4*3.142*r*r*r)/3.0;
double fb = v*62.4;
if(fb>=w)
{
cout<<"The sphere will float"<<endl;
}
else
{
cout<<"The sphere will sink"<<endl;
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.