Finding weight on various different planets
it's definitely WAY above what I've learned so far


So I try...

An answer for beginners

The code is mostly alright, sure, using an enum would help and so would Java 8 features. But let's state the simple things:

public class SpaceBoxing 
{


The opening brace should be written on the same line and separated by a single space.

static Scanner keyboard = new Scanner(System.in);


You're creating a Scanner, which is Closeable and ideally should be closed. Usually, failing to do so means leaking resources and can make your program crash (e.g., you can't open a file as there are already 1000 open file descriptors).

But you're lucky: Your Scanner only wraps the underlying InputStream System.in and itself uses no system resources. So let's forget it for now.



static double computeEffectiveWeight(double weight, int choice)
    {
        double realWeight = 0;


Be consistent. Is the weight "real" or "effective"?

        if(choice == 1)


Space after if (to distinguish it visually from a method call).

You'd better always use braces, even around a single statement as it's less error-prone.

            realWeight = (weight * 0.78);


Needless parentheses. And also a needless variable. It'd clearer to write

        if (choice == 1) {
            return weight * 0.78;

        } else if (choice == 2) {
            return weight * 0.39;

        ...

        } else {
            return 0;
        }


But you probably should throw an IllegalArgumentException instead of returning 0 for an illegal argument.

Actually, this is a clear case for a switch:

       switch (choice) {
           case 1: return weight * 0.78;
           case 2: return weight * 0.39;
           ...
           default: return 0; // or better throw
       }





  I'll definitely look into it more, but I got the code working, and I guess "why break it if it ain't broke"


That's a good rule in general, but after applying it consequently for one month, you'll wish you never wrote a single line. ;) Don't hesitate to change code if it can get clearer and simpler. Learn writing tests so you don't have to be afraid of change.

Simple enum usage

As the next step, I'd go for enum Planet exactly like h.j.k. did. Modify getPlanetChoice to return it like

static Planet getPlanetChoice() {
    Planet[] planets = Planet.values();
    while (true) {
        System.out.println("I have information on the following planets: ");
        System.out.println("1. Venus");
        System.out.println("2. Mars");
        System.out.println("3. Jupiter");
        System.out.println("4. Saturn");
        System.out.println("5. Uranus");
        System.out.println("6. Neptune");
        int index = keyboard.nextInt() - 1;
        if (0 &lt;= index &amp;&amp; index &lt; planets.length) {
            return planets[index];
        }
        System.out.println("\nPlease try again.\n");
    }
}


and then get the needed information out of the returned Planet.