Question

Problem: Write a program to calculate the force of gravitational attraction between two objects of known mass at a known dist

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

#include <iostream>
#include<iomanip>
using namespace std;

int main()
{
const double G=6.67e-11;
double d,m1,m2,F;
cout<<"Please enter the mass of first object in kgs: ";
cin>>m1;
cout<<"Please enter the mass of second object in kgs: ";
cin>>m2;
cout<<"Now, enter distance between objects in meters: ";
cin>>d;
F=G*m1*m2/(d*d);
cout<<fixed;
cout<<scientific;
cout<<"For an object of mass: "<<setprecision(2)<<m1<<" kgs and another of mass: "<<setprecision(2)<<m2<<" kgs at a distance of "<<setprecision(2)<<d<<" meters\n";
cout<<"The gravitational force is "<<setprecision(2)<<F<<" Newtons\n";
  
return 0;
}

M Inbox (1) - gurkaranpre x C Computer Science ques X Online C++ Compiler - X C My Q&A | Chegg.com x C My Q&A | Chegg.com ~ K

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Problem: Write a program to calculate the force of gravitational attraction between two objects of known...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • General Overview: Any two objects will exert an attractive force on the other. The force is...

    General Overview: Any two objects will exert an attractive force on the other. The force is given as directly proportional to the product of the masses and inversely proportional to the distance from the the objects centers of mass squared. Those values will not give the unit of Newtons (N), therefore there must a constant value G called the Universal Gravitation constant that has the value and units of 6.67 x 10-11 N m/ kg". Big G gives meaning to...

  • QUESTION 1 An Atwood Machine consists of two masses connected to a cord which is draped...

    QUESTION 1 An Atwood Machine consists of two masses connected to a cord which is draped over a pulley. In our experiment, what will be true about the masses? Mass 1 will vary with Mass 2 held constant. Mass 1 will vary with Mass 2 held constant. The masses will have a constant sum. The masses will have a constant mass difference. 3 points    QUESTION 2 You will get a value for acceleration for each trial from a LoggerPro...

  • Laboratory Unversal Gravitational Law please answer all 3 cases. thank you Laboratory universal gravitational law Answer...

    Laboratory Unversal Gravitational Law please answer all 3 cases. thank you Laboratory universal gravitational law Answer all cases please. (Equation 11 Where: - mass of one object in ks - mass of the other object in kg G-Newton's Universal Gravitational Constant r - distance between the two masses in meters Case 1: Glven two masses. - 100 kg = 400 kg, and the attractive force between the two masses is Newtons Case 2: Glven two masses... 230 kg. - 280...

  • Given Newton's law of universal gravitation where F is the force between two masses objects, m1...

    Given Newton's law of universal gravitation where F is the force between two masses objects, m1 and m2 are the masses of the two bodies and r is the distance between the two bodies. Determine the units of G in two ways 1) including Newtons, N, as one of the units and 2) not including N. (hint...if you don't recall what the dimensions of N are, think of Newton's second law!

  • A. The force of gravity acting between two objects is given by the equation F=G(m1m2/d2), where...

    A. The force of gravity acting between two objects is given by the equation F=G(m1m2/d2), where G is the gravitational constant, G=6.674×10−11N⋅m2/kg2. m1 and m2 are the masses of the two objects, and d is the distance separating them. What is the gravitational force of attraction (in Newtons) between the electron and proton? Use the same distance: 2×102pm. Mass of an electron, me=9.109×10–31kg Mass of a proton, mp=1.673×10−27kg Express your answer to two significant figures and include the appropriate units....

  • 2. strength of the gravitational force exerted by the planet on the moon be denoted by...

    2. strength of the gravitational force exerted by the planet on the moon be denoted by F, and let the strength of the gravitational force exerted by the moon on the planet be F A moon of mass m orbits a planet of mass 100m. Let the (a) What will be the ratio of F, to F,? (b) The planet Pluto has 1/500 the mass and 1/15 the radius of Earth. What is the value of g on the surface...

  • Compute the columbic and gravitational forces between two electrons separated by a distance of: 1 106...

    Compute the columbic and gravitational forces between two electrons separated by a distance of: 1 106 meters. The Universal Gravitation Constant is 6.67 10-11 mg/kg/s. The mass of an electron is 9.1 10-31 kg and k= 9 10 NmİC. Form the ratio of Coulomb force to gravitational force, which is bigger?

  • Two spherical objects have a combined mass of 170 kg . The gravitational attraction between them...

    Two spherical objects have a combined mass of 170 kg . The gravitational attraction between them is 8.33×10−6 N when their centers are 17.0 cmapart. A.What is the mass of the heavier object? B.What is the mass of the lighter object?

  • Two spherical objects have a combined mass of 160 kg . The gravitational attraction between them...

    Two spherical objects have a combined mass of 160 kg . The gravitational attraction between them is 7.76×10−6 N when their centers are 16.0 cm apart. A) What is the mass of the heavier object? B) What is the mass of the lighter object?

  • Two objects are attracted to each other by a gravitational force F. If each mass is...

    Two objects are attracted to each other by a gravitational force F. If each mass is tripled and the distance between the objects is cut in half, what is the new gravitational force between the object in terms of F? a) 36 F b) 16F c) (1/16)F d) 24F

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT