/Weight-On-Different-Planets

Your weight is different on other planets in the Solar System because the gravity is different. The following code tells you what will be your weight on different planets, dwarf planets and moons. You can measure your weight in units of kilograms and the unit will be the same on the other planet.

Primary LanguageJavaMIT LicenseMIT

Python VS Java

Prerequisites

  • Python
  • Java

Weight On Different Planets

Your weight is different on other planets in the Solar System because the gravity is different. The following code tells you what will be your weight on different planets, dwarf planets and moons. You can measure your weight in units of kilograms and the unit will be the same on the other planet.

The following code work on this formula:

Weight on any planet = Weight on Earth / 9.81 m/s^2 x Gravitational force on that planet

Terms :

  1. Gravitational forces of Earth is 9.81 m/s^2
  2. Gravitational forces of different planets, dwarf planets and moons

Planets:

  1. Mercury has gravitational force of 3.7 m/s^2
  2. Venus has gravitational force of 8.87 m/s^2
  3. Earth has gravitational force of 9.81 m/s^2
  4. Mars has gravitational force of 3.721 m/s^2
  5. Jupiter has gravitational force of 24.79 m/s^2
  6. Saturn has gravitational force of 10.44 m/s^2
  7. Uranus has gravitational force of 8.87 m/s^2
  8. Neptune has gravitational force of 11.15 m/s^2

Dwraf Planets:

  1. Pluto has gravitational force of 0.62 m/s^2
  2. Eris has gravitational force of 0.82 m/s^2
  3. Ceres has gravitational force of 0.27 m/s^2

Moons:

  1. Moon has gravitational force of 1.622 m/s^2
  2. Encelaedus has gravitational force of 0.113 m/s^2
  3. Titan has gravitational force of 1.352 m/s^2
  4. Europa has gravitational force of 1.315 m/s^2
  5. IO has gravitational force of 1.796 m/s^2
  6. Ganymede has gravitational force of 1.428 m/s^2
  7. Callisto has gravitational force of 1.236 m/s^2
  8. Cyllene has gravitational force of 0.001 m/s^2

Python

Output of python code:

Screenshot (8)

Java

Enter your weight in KGs and then choose any number of given planet to find your weight on that planet.

Output of Java code:

weights by java

Author Name

Vikrant