adplus-dvertising
Coders Packet

Weight on a planet using Java

By Penakacherla RaviTeja Yadav

The programming language used in the source code is Java. This program tells how much do you weigh on the different planets based on your weight on earth.

This program tells how much do you weigh on the different planets based on your weight on earth. We do this by finding mass and multiplying mass with a gravitational constant of the respective planet. Users can also add the different planets and it's their gravitational constant to the program and use it later for finding weight. Users can also delete the particular planet from the available list of planets.HashMap is used to store planet name and gravitational constant as key-value pair.

 

- add() : Function adds the Planets .

 

- remove() : Function deletes the planet from available list of -planets,

 

NOTE :

 

Mass can be found by dividing weight with Earth's gravitational constant(9.8).

Download Complete Code

Comments

No comments yet

Download Packet

Reviews Report

Submitted by Penakacherla RaviTeja Yadav (Raviteja528)

Download packets of source code on Coders Packet