Imperative Programming

The positions of the boat are stored in a two-dimensional array, which is iterated over when the boats are displayed.

class BoatLoop {
    String [][] boats;
    String origin;
    String destination; 
    String ocean;

    public BoatLoop() {
        boats = new String[][]{
            {
                "               __|_|__|_|__",
                "               _|____________|__",
                "               |o o o o o o o o / " ,
            },
            {
                "                                   __|_|__|_|__",
                "                                   _|____________|__",
                "                                   |o o o o o o o o / " ,
            },
            {
                "                                                       __|_|__|_|__",
                "                                                       _|____________|__",
                "                                                       |o o o o o o o o / " ,
            },
            {
                "                                                                             __|_|__|_|__",
                "                                                                             _|____________|__",
                "                                                                             |o o o o o o o o / " ,
            },
            {
                "                                                                                               __|_|__|_|__",
                "                                                                                               _|____________|__",
                "                                                                                               |o o o o o o o o / " ,
            }
        };   
        this.getCities();
        this.printBoats();     
    }
    

    public void getCities() {
        Scanner input = new Scanner(System.in);
        
        System.out.println("Where are you starting from?");
        origin = input.nextLine();
        System.out.println(origin);
        
        System.out.println("\nWhere do you want to sail to?");
        destination = input.nextLine();
        System.out.println(destination);
        ocean = String.format("%s---~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~'~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`--------%s", this.origin, this.destination);
    }
    
    public void printBoats() {
        for(int i = 0; i < boats.length; i++) {
            for(String line: boats[i]) {
                System.out.println(line);
            }
            System.out.println(this.ocean);
        }
        
        System.out.println(String.format("Yay! You reached %s", destination));
    }

    public static void main(String[] args)  {
        new BoatLoop();
    }
}

BoatLoop.main(null);
Where are you starting from?
LA

Where do you want to sail to?
Hawaii
               __|_|__|_|__
               _|____________|__
               |o o o o o o o o / 
LA---~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~'~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`--------Hawaii
                                   __|_|__|_|__
                                   _|____________|__
                                   |o o o o o o o o / 
LA---~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~'~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`--------Hawaii
                                                       __|_|__|_|__
                                                       _|____________|__
                                                       |o o o o o o o o / 
LA---~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~'~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`--------Hawaii
                                                                             __|_|__|_|__
                                                                             _|____________|__
                                                                             |o o o o o o o o / 
LA---~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~'~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`--------Hawaii
                                                                                               __|_|__|_|__
                                                                                               _|____________|__
                                                                                               |o o o o o o o o / 
LA---~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~~'~'`~'`~'`~'`~'`~'`~'`~'~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`~'`--------Hawaii
Yay! You reached Hawaii