Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a Exercise 2:- To find the weight of an object/matter on different planets it is important first to explore the difference between mass and weight.
a Exercise 2:- To find the weight of an object/matter on different planets it is important first to explore the difference between mass and weight. Mass is measurement of the amount it contains and weight is the force generated by the gravitational attraction of one object on another. This mass does not change when we change planets. However, if we went from Earth to Mars, weight would change because Mars has less gravity than Earth. Gravity is a force pulling matter together. Gravity of a planet can be calculated by using following formula G*M r2 Where G is a gravitational constant whose value is 6.673x10-11 Mis mass of the planet in Kilograms ris radius of the planet in meters. Diameter is equal to 2 times of radius. . Weight of any object/ matter can be computed as acceleration due to gravity force (F) times mass of an object, that can be represented as w=Fg* m Where m is the mass of an object/matter Following table shows the mass and diameter the planets. Diameter Planets Mass (Kgs) (m) Mercury 3.301x1023 4.879x 10 Venus 4.867x1024 1.2104x107 Earth 5.98x1024 1.276x107 Mars 6.417x1023 6.794x100 Jupiter 1.899x1027 1.429x10 Saturn 5.685x1026 1.205x108 Uranus 8.682x1025 Neptune 1.024x1026 Pluto 1.471x1022 5.112x107 4.953x107 2.37x106 Write a C++ program that reads name of the planet, mass of the planet and its diameter. Your program should also read the mass of the matter/object to compute its weight Declare appropriate variables and constants Display gravitational force (Fg) of the planet and weight(wt) of the object as shown in the sample run. Format the output and resultant values as shown in the sample run. Sample Run: G. C:\Windows\system32\cmd.exe Computing Weight of objects on different Planets Please enter the name of a planet : Earth Enter the mass of a planet(M) : 5.98e24 Enter diameter of the planet : 1.276e7 Enter the mass of an object(m): 15 Planet Gravity m/s Weight of the object Kgs Earth 9.8 147.052 Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started