Question: Java: Please help with my following code. I am trying to get the following result, but cannot figure out my loop. Or if you see

Java: Please help with my following code. I am trying to get the following result, but cannot figure out my loop. Or if you see a better way, please show me. thank you.

Output I am aiming for:

Java: Please help with my following code. I am trying to getthe following result, but cannot figure out my loop. Or if you

Code I have so far:

public class SpaceShipTester {

//private static final Object Object = null;

public static void main(String[] args) {

Traveler t1= new Traveler();

t1.setId();

t1.setName("Naomi");

t1.setCurrent(Location.EARTH);

System.out.println("Traveler " + t1.getID() + " "+ t1);

Traveler t2 = new Traveler("Klaes", Location.MARS);

System.out.println("Traveler " + t2.getID() + " "+t2);

Traveler t3 = new Traveler("Lucinda", Location.MOON);

System.out.println("Traveler " + t3.getID() + " "+t3);

Traveler t4 = new Traveler("Amos", Location.MARS);

System.out.println("Traveler " + t4.getID() + " "+t4);

System.out.println(" ");

//for(int i = 1; i

// System.out.println("Date for Traveler " + t1.getID());

// if(t1.equals(Object))

// System.out.println("Name: " + t1.getName());

// if(t1.equals(Object))

// System.out.println("Current: " + t1.getCurrent());

// if(t1.equals(Object))

// System.out.println("Traveler " + t1.getID());

// System.out.println(t1);

for(int i = 1; i

System.out.println("Date for Traveler " + t1.getID());

System.out.println("Name: " + t1.getName());

System.out.println("Current: " + t1.getCurrent());

System.out.println("Traveler " + t1.getID() + " " + t1);

System.out.println(" ");

}

}

}

SpaceShipTester class with a main method: A text-based driver program that performs the following steps: a. It asks for four Travelers and two StarShips (Part 1, below) b. It executes a text-menu with the following options (Parts 2-4 below) 1. Add traveler to a Spaceship 1. Search for traveler on a Spaceship 11. Move a spaceship to a new location . Exit the program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!