Skip to content

Instantly share code, notes, and snippets.

@alex-ber
Created February 29, 2024 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex-ber/094836660aa8fe6c6059be318a595741 to your computer and use it in GitHub Desktop.
Save alex-ber/094836660aa8fe6c6059be318a595741 to your computer and use it in GitHub Desktop.
public static void main(String[] args) {
double earthWeight = Double.parseDouble(args[0]);
double mass = earthWeight/EARTH.surfaceGravity();
for (Planet p : Planet.values())
System.out.printf("Your weight on %s is %f%n",
p, p.surfaceWeight(mass));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment