Buoyancy is the ability of an object to float. Archimedes’ Principle states that
ID: 3873377 • Letter: B
Question
Buoyancy is the ability of an object to float. Archimedes’ 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: Where Fb is the buoyant force, V is the volume of the submerged object, and 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. Draw the flow chart and 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. Hint: Use = 62.4 lb/ft3 as the specific weight of water. The volume of a sphere is computed by (4/3)r3 .in java program
Explanation / Answer
Buoyancy program:-
#include <iostream>
#include <cmath>
#include <math.h>
using namespace std;
double sphere_volume (double);
double buoy_force (double,double);
int main ()
{
double rad,volume,force,buoyancy;
double weight;
double water = 62.4;
cout << "~~Buoyancy calculator~~" << endl;
cout << "Please enter the radius of your sphere" << endl;
cin >> rad;
cout << "Please enter the weight of your sphere" << endl;
cin >> weight;
volume = sphere_volume(rad);
force = buoy_force(volume, weight);
if (force <= water)
cout << "Your sphere will float in the water"<<endl;
else
cout <<"Your sphere will sink :( "<<endl;
return 0;
}
double sphere_volume (double radius)
{
double vol;
vol = ((4/3) * (M_PI) * (pow(radius,3)));
return vol;
}
double buoy_force (double vol,double weight)
{
double force;
force = vol * weight;
return force;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.