Code Monkey home page Code Monkey logo

thevkrant / weight-on-different-planets Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 23 KB

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.

License: MIT License

Python 49.09% Java 50.91%
java python python-vs-java

weight-on-different-planets's Introduction

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

weight-on-different-planets's People

Contributors

thevkrant avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.