Humankind has expanded into space. Humans live and work in cities in space. To maintain and construct these cities, is the responsibility of a dedicated workforce.

The people who carry out this work are known as Crew.

A pilot program was started in which each Crew had their own spaceship, known as a Ship. This prototype was explored in AssignC and proved to be very successful. Now the program is to be expanded.

Now the Ship's carry a maximum of 10 Crew. Tasks are now assigned to Ship's, not to individual Crew.

The Crew is still trained to undertake any sort of Task and their Ship's can be configured in any way, regardless of the stated purpose of the Ship. As before, some Tasks are more difficult and dangerous than others. As such, some Tasks can only be performed by highly experienced Crew. When considering assigning a Task, the Task is still rated as requiring a certain minimum level of experience points. Now, however, as the Task is assigned to a Ship, it is the total number of experience points of all the Crew in the Ship that determine whether or not the Ship can be assigned the Task. Also, as before, the Ship has to have the status of "available" before even considering whether the Ship can be assigned the proposed Task, this has not changed.

When a Crew joins the space city, they start with 0, or more, experience points. Each time a Ship successfully completes a Task, all of the Crew in the Ship gain 10 experience points. Some Tasks are especially challenging and bonus points may still be awarded, now there is no maximum, although the bonus points must be greater than 0. These bonus points are shared equally amongst all the Crew in the Ship, regardless of the classification of the individual Crew. The number of experience points still determines the classification of the Crew, but no longer determines the Tasks that they may be assigned as it is the Ship that is assigned a Task.

The four levels of experience remain the same - this is the classification of the Crew

  • Trainee 0 to 20 experience points (inclusive)
  • Trained 21 - 40 experience points (inclusive)
  • Experienced 41 - 100 experience points (inclusive)
  • Specialist greater than 100 experience points

The Ships that the Crew use are still sometimes damaged during a Task. (You may assume that a Ship is never destroyed). A Ship has a status, which can be one of:

  • available
  • damaged
  • being repaired
  • on task

This is the same as in AssignC, with all the same conditions.

Now that Ship's are big enough to have a number of Crew, there is no need for a WorkUnit. The WorkUnit proved to be successful in the prototype but has now been dropped completely from this program.

As stated above, to be assigned a Task, the Ship must be available and total number of experience points of all the Crew must be greater than or equal to the experience points required of the Task. If the Ship is available, this automatically means that all the Crew are available. Tasks are assigned to the Ship and when the Ship finishes the Task the Ship's crew notify the central control. Tasks do not have a fixed time length.

Program Requirements

You have been asked to write an interactive program, in Java, to aid in monitoring and maintaining all aspects of Tasks, Crew and Ship's, that is, maintaining the Space City.

This prototype program (AssignC) proved very successful and is now expanded. The space city now has a maximum of 100 Ship's. Each Ship has a maximum of 10 Crew.

To aid in the rapid development of this program, 3 Java files and 1 sample input file are provided for you:

Crew.java, Ship.java, SpaceCity.java and a sample input file city01.dat

WARNING

You can re-use large parts of your AssignC Ship.java and Crew.java files and some parts of SpaceCity.java.

Before you copy the start-up files for this assignment from the directory listed below, MAKE SURE THAT YOU CREATE A SEPARATE DIRECTORY FOR THIS ASSIGNMENT! Change into this new directory first, then enter the copy command listed below.

If you do not create a separate directory and run the copy command, you will overwrite your AssignC Ship.java and Crew.java and we cannot recover these files. You will have to start all over again.

After you have copied the start-up files, compile them and run the program to see how the expanded menu structure fits together. The Ship.java and Crew.java files from the library area are empty, just to get the driver class, SpaceCity.java, to compile.

After you compile and run the program, begin by reading the changes that are required in Crew.java (not many) and Ship.java (quite a few) then copy your AssignC Crew.java and Ship.java into your new directory and re-compile the program, it should still compile, but won't do anything yet. (Don't copy WorkUnit.java, this has been dropped from this assignment.)

Copy them from the unit library area into your current directory using:

cp /home/1st/csilib/cse1oof/prog/* .

In order to further speed up the development of this program, some of the files listed above have been partially implemented for you, read the comments in the files.

Crew.java (This remains basically the same as in AssignC)

All Crew objects have the following object attributes:

  • name This a String (text) and is the name of the Crew, may be more than one word
  • classification This is one of the four classifications, Trainee, Trained, Experienced or Specialist. Recall that this entirely based on the number of experience points
  • status This is a boolean, true indicates that the Crew is available to be, potentially, assigned a Task, false indicates that the Crew is not available to be assigned a Task.
  • id This a String (text) and is the unique id of the Crew, may consist of any combination of digits and characters, including spaces.
  • experience points This is an integer and is the number of experience points that the Crew has acquired.

The Crew class requires the following functionality:

A constructor that takes name, id and experience points as parameters. This is the constructor that is called when a new Crew is added from the keyboard. Recall that the classification is set by the number of experience points and the status must be true as the Crew has just be instantiated and so cannot have been assigned a Task.

The classification must never be set by the user.

An overloaded constructor that takes all five attributes listed above as parameters. This constructor is called when constructing a Crew object from data read from a text file. The text file (see the format on page 10) has a record of previously entered Ship objects (this includes information about the Crew). There are no calculations, just assign the data from the file to the appropriate attribute.

You may consider writing a further overloaded constructor for the Crew class. This is the "copy constructor" as discussed in lectures relating to preventing privacy leaks. The "copy constructor" takes as its single parameter, an existing Crew object reference and copies all the values from this existing Crew object to the new Crew object being instantiated.

The Crew class requires a private method to set the classification, based on the experience points. (Hint: this will need to called from the keyboard constructor, but not from the file read constructor)

The Crew class also requires a method to change the status attribute. This simply toggles the status attribute when called. If the status attribute is true, calling this method sets it to false, if the value is false when this method is called, then the value is set to true. As such, this method does not take a parameter.

The Crew class also requires a method to add experience points. Calling this method adds 10 experience points. Hint: this may change the classification of the Crew, you need to check.

The Crew class also requires an overloaded method to add experience points, this method takes one parameter, the number of extra points to add. There is now no maximum to the number of bonus experience points that may be added, although the number must be greater than 0. Otherwise the extra experience points are added to the total experience points. Hint: this may change the classification of the Crew, this method needs to check.

There is no longer any need to have a method to check if an individual Crew is available to undertake a Task. This is now determined in the Ship class, so the available method in the Crew class may be removed. If the Ship that holds this Crew is working on a task, then the Crew is to be shown as unavailable, any other status for the Ship means that the Crew should be shown as available.

The Crew class still requires a toString method which returns a String with information about the Crew object, see pages 16 -17 for the format of the String to be returned.

Finally, you might consider adding a method to the Crew class that takes a PrintWriter object reference (or any other suitable output text file class) as a parameter. Both the Crew and Ship will need to be written back to a text file in this assignment. How to write to text files is explained at the end of this document.

Ship.java (Quite a few changes)

The Ship class has the following attributes:

  • id This is a String (text) and is the unique identifier of the Ship, may consist of any combination of digits, characters and spaces
  • status This is a String and consists of one of the following:
    • available
    • damaged
    • being repaired
    • on task
  • purpose This is a String (text) and is the purpose of the Ship, may be more than one word.
  • crew This is an object reference for an array of Crew objects
  • counter This is an int and holds the value of the next free space in the crew array
  • CREW_SIZE This is a constant int, value 10, that represents the maximum number of Crew that can be in the crew array

The Ship class still requires a constructor that takes as parameters just the id and the purpose. This constructor is called when instantiating an object with information from the keyboard. The status must be available as the Ship object has just been instantiated so it cannot have been assigned a Task. When instantiating a Ship object from the keyboard, no Crew information is entered, although you need to consider where you are going to instantiate the crew array.

The Ship class also still requires an overloaded constructor that takes as parameters, all three attributes. This constructor is called when instantiating an object with information read from a text file. The text file will hold the values of a previously constructed Ship object and we are now restoring that object. Even though all the information for all the Crew in this Ship will be available in the text file, immediately after the Ship information, the restriction about not creating Crew or Ship objects in the main driver program (SpaceCity.java) remains. This means that this constructor should stick to just the three parameters as in AssignC. Again, if you start by reading from a text file, then you need to consider where you are going to instantiate the crew array. (Hint: you can do this instantiation outside of any constructors, but you must instantiate the crew array somewhere in the Ship class)

The Ship class will require accessor methods as you deem appropriate.

The Ship class also requires a toString method that returns a String with information about the state of that Ship object. The format of the String is shown in the example output on page 21. Note that the toString method will now also have to return all the Crew associated with this Ship.

The Ship class still requires a mutator method to change the value of the status attribute. This method takes one parameter, a String with the new status.

  • If the value of the new status parameter is on task, then the status attribute of the Ship is set to this new value, if and only if, the current value of the status attribute is available.
  • If the value of the new status parameter is being repaired, then the status attribute of the Ship is set to this new value, if and only if, the current value is damaged.
  • If the value of the new status parameter is damaged, then the status attribute of the Ship is set to this value, if and only if, the current value of the status attribute is on task
  • If the value of the new status parameter is available, then the status attribute of the Ship is set to this value, if and only if, the current value of the status attribute is on task or being repaired. (available is when the status was on task and End Task is called with the Ship not being damaged or when the Ship was not on a Task and finishes being repaired.)

This method now requires some additions. When the Ship status is on task, all of the Crew in this Ship must have their status set to unavailable (false). When the Ship has any other status all the Crew must have their status set to available (true).

Any other combination of new status parameter value and current Ship status attribute value is an error, has no effect on the Ship status attribute and an appropriate message should be displayed to the screen.

Other additions to the Ship class include a method to add a Crew to the crew array. This method should take just the parameters required when adding a Crew from the keyboard. This method should, of course, check there is a free space in the crew array and increment the counter after adding the Crew. This method adds just one Crew each time it is called.

There will need to an overloaded version of the above method to add a Crew member to the crew array. This overloaded method will be called when reading from the text file, as all the information for all the attributes of a Crew are available in the text file. This method also, of course, needs to check that there is actually space in the crew array before instantiating a Crew object and adding it to the crew array, also incrementing the counter.

As there is no WorkUnit.java any more, the Ship class will require a method to add experience points to all the Crew associated with the Ship, when a Task is ended.

Another method that will be required is a method to add bonus points to all the Crew associated with this Ship. This method will take one parameter, an int which is the total number of bonus points for all the Crew in this Ship. The bonus points, which must, of course, be greater than 0, are shared equally between all the Crew, regardless of the individual classification of the Crew. Any points that are left over are discarded.

For example, if there were 4 Crew in a Ship and the bonus points passed in had the value 19, then each Crew would receive 4 points and the remaining 3 points would be lost.

For bonus marks, work out a way of distributing these "extra" points so that none are lost, how is up to you.

Another method that you may consider adding is a method that takes a PrintWriter object reference, as described in Crew that writes all the details of the Ship to the text file associated with the PrintWriter object.

However you decide to do this writing to a text file, be aware that you will need to write an "extra" number into the text file, this is the number of Crew in the particular Ship. This number is required so that when you read the text file into the array, you know how many Crew records are associated with the particular Ship.

There are a number of other methods you may consider. For example, you may want to write a method that returns a copy of the crew array, without privacy leaks (recommended). You might want to write a method that returns a String that contains just the Ship information, no Crew information.

You will very likely need a method that returns the total experience points of all the Crew associated with this Ship. This would be required when determining whether or not the Ship could be assigned a Task (always assuming the Ship status is available)

Recall that there is now no WorkUnit.java class in this assignment.

As in AssignC, Crew and Ship classes do NOT ask the user for any input, either keyboard or file. There must not be any input objects in these classes such as Scanner or BufferedReader but not limited to these 2. Another way of saying this is that these classes are not interactive. They can, however, have text file output classes and objects.

Much of the main driver program, SpaceCity.java, stays the same, there are a number of additions.

The driver program, SpaceCity.java now starts by asking the user for the name of an input text file. You may assume that this file always exists and is in the correct format (see page 10), although this file may be empty. Assuming the input text file is not empty, then the program reads all the information from the text file into the ships array. The program must work with any file name entered by the user (of the correct format), that is, the file name must not be hard coded.

An example of the information, in the text file, for each Ship consists of 3 lines for the Ship and up to 10 Crew records, as follows (this is known as a record): see image.

The first 3 lines are required to instantiate the Ship object in the next free space of the ships array. Then addCrew (from the Ship class) would be called 3 times to add the 3 Crew to the crew array of that Ship, as the Crew information is read out of the text file.

The file may contain any number of records.

Then the file is closed and all interactions in the program are with the array, expect, of course, writing the array back to an output text file.

Many of the actions in this main driver program require searching for a particular Ship, by its id, in the ships array. It is strongly recommended that you write a search method that takes one parameter, the id of the Ship to search for, and returns the index of that Ship in the array, or -1 if the Ship is not found. Writing this method once means that it can be called anywhere, rather than repeating the same code in methods that require the index of a Ship.

After the file load, the program then presents the user with a menu, as follows:

SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >>
Note: SpaceCity class must NOT have Ship or Crew object attributes. If you write a method to return a copy of the crew array (from Ship) then a local variable to accept this return is permitted (and required) and, of course, you have to call the Ship constructor in SpaceCity to add a Ship to the ships array.

Implement the functionality of each menu choice as follows (assume user input is always an integer):

1. Display Menu

This menu choice displays a sub menu like this:

SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >>

If the user selects choice 1, then the contents of the ships array (including Crew information) is displayed to the screen.

If the user selects choice 2, then only the information about all the Ships (no Crew information) in the ships array is displayed to the screen.

If the user selects choice 3, then only the information about all the Crew (no Ship information) in the ships array is displayed to the screen.

If the user selects choice 4, then the user is prompted (asked) for the id of a Ship. If there is a matching Ship in the array, then all the information about this Ship, including any Crew in this Ship, is displayed to the screen.

If the user selects choice 5, then the user is prompted (asked) for the id of a Crew. If there is a matching Crew in one of the Ships in the array, then all the information about this Crew, no Ship information, is displayed to the screen.

As a final note, consider that when the user enters Crew id and Ship id from the keyboard, the program must check that these id's are not already in use. If they are then the user is informed with an appropriate message to the screen and the user can be asked to enter another id or the method can return to the main menu.

Id's in the input file are guaranteed to be unique and you may assume that the user will not enter an id (of either Crew or Ship) from the keyboard that is in the input text file. Your program does NOT need to check for this, but it needs to check id's already in the array.

2. Add Task

This menu choice first checks that there is at least one Ship in the ships array, if not, then an appropriate message is displayed to the screen and the program returns to the main menu. If there is at least one Ship object reference then the user is prompted (asked) for the id of a Ship. The program must then find the Ship that contains that id in the ships array. If the Ship with that id is found and the Ship has the status of available, then the user is prompted (asked) for the number of experience points required to carry out the potential Task. If the total number of experience points of all the Crew in this Ship is greater than or equal to the points needed for the Task, then the Ship (and its Crew) is assigned the Task, with the appropriate change in status of both the Ship and all its Crew.

The program always returns to the main menu at the end of the menu choice, regardless of the action taken or not taken.

3. End Task

This menu choice prompts (asks) the user for the id of a Ship. As with Add Task appropriate messages should be displayed to the screen if the Ship with that id is not found or if the Ship with that id is found but is not already on a Task. (You can't end a Task unless the Ship is currently on task)

If any of the above are true then the program returns to the main menu.

If the id exists and the Ship is on task, then the user is prompted (asked) if the Ship has been damaged, if the answer is yes, then the Ship status is changed to damaged, if not, the Ship status is changed to available.

Regardless, the Crew status of all Crew in this Ship is changed from false to true.

Also, 10 experience points are added to the total experience points of each one of the Crew in this Ship, this may result is a change of classification.

The user is also prompted (asked) if bonus experience points should be awarded. If the answer is yes then the user is asked to enter the points and these are shared equally between all the Crew in that Ship and this share is added to the total experience points of each Crew in this Ship, again, this may result in a change of classification. The program needs to check for this as described above in the Crew information. Reminder, there is now no upper limit to the bonus awarded and any "left over" bonus points are discarded (Although you are free to write code to solve this, as a bonus marks task)

After the conclusion of any and all actions in this menu choice, the program returns to the main menu.

4. Change Ship Status

This menu choice prompts (asks) the user for a Ship id (after doing the same checks and appropriate actions as in Add Task and End Task menu choices, if the Ship id does not exist).

If the Ship id is found, the user is prompted (asked) for the new status of the Ship. This new status must follow the rules as described above in the Ship class. For instance, a Ship that has current status of available cannot be given a new status of being repaired.

If the Ship status is currently on task, then the user must be advised that changing the status will end the task. The user is given the choice of proceeding or cancelling the action. If the user chooses to proceed then all the actions for End Task must be called.

If the current status of the Ship is damaged, for example, then the Ship cannot be on task and the only change that can be made is to make the status being repaired.

Reminder, changing the status of the Ship may change the status of the Crew associated with this Ship, this is detailed above in the Ship class. Some changes to the Ship status will not change the Crew status.

5. Add Ship

This menu choice first checks that there is space in the ships array. If there is no space then the user is informed with an appropriate message and no further information is asked from the user.

If there is space in the array then the user is asked for the id of the Ship to add. If this id is already in use, then, once again, the user is informed of this fact. (Hint: good use for your search method. ) If this occurs, your program can return to the main menu, or ask the user if they would like to enter another id.

If the program gets to this point where the user enters a valid Ship id, then the user is prompted for the purpose of the Ship and that Ship is added to the array (remembering to increment the counter). No Crew information is requested in this menu choice, just Ship information.

6. Add Crew

This menu choice first checks that there is at least one Ship in the array. If there are no Ships, then the user is informed with an appropriate message and the program returns to the main menu.

If there is at least one Ship in the array then the user is prompted (asked) for the id of a Ship. If there is no Ship with this id in the array, again, the user is informed with an appropriate message and the program can either return to the main menu or ask the user if they want to enter another Ship id.

If the Ship with the requested id is found in the array (search method again), then the user is prompted (asked) for the id of the Crew to be added. This requested id must be checked that it is not already in use.

This is a somewhat complex process as the program needs to look at all the Crew in all the Ships in the array. One way of doing this is to use your getCrew method from Ship class to return a copy of the Crew array for a Ship into this main program, then go through the copy of that Crew array. You do this one Ship at a time until you have searched all the Ships in the array, or you find that the requested Crew id already exists (it doesn't matter in which Ship the Crew id is found)

If your program gets to this point, then we know that the requested Crew id is unique and the user is prompted (asked) for the rest of the Crew information (keyboard entry, see Crew class, reminder that the user never enters the classification of the Crew). That information is passed to the addCrew method of the appropriate Ship object and the Crew is added to the crew array of that Ship.

Something to consider, at what point do you check that there is actually space in the crew array of the Ship object?

7. Save

This menu choice prompts (asks) the user for the name of an output text file. This can be the same name as the input file or a different file name. Regardless, the output file name must not be hard coded. The contents of the ships array is then written back to this output file. This does not close the program.

You must pay careful attention to the way that you write back to this output text file. You must follow the same format as the input file (see page 10). Your output text file must be able to be used as an input file the next time the program is run.

8. Exit

This menu choice closes the program. It is up to you whether or not you ask the user if they want to save before exiting. This menu option must not, however, automatically call save

Example run of the program (NOTE not all functionality and error checks/messages are shown)

> java SpaceCity
Enter input file name >> e
This is an empty file, no Ships added
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 1
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 1
No ships in the city
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 6
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 2
No Ships present
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 4
No Ships present
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 8

Another run of the program

> java SpaceCity
Enter input file name >> city01.dat
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 1
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 1
Here is the list of Ships and Crews
Ship[
id: A 10 purpose: Heavy Engineering status: available
Here is the list of Crew
Crew[
name: Carl Tonius id: HE 01 classification: Experienced
points: 45 status: available
]
Crew[
name: Mister Scott id: E 100 classification: Specialist
points: 110 status: available
]
]
Ship[
id: T 01 purpose: Tour Bus status: on task
Here is the list of Crew
Crew[
name: Fastus Driverius id: D 4 classification: Experienced
points: 67 status: task assigned
]
]
Ship[
id: IT 15 purpose: IT and Comms status: damaged
Here is the list of Crew
Crew[
name: Comp Gen id: T 02 classification: Trainee
points: 19 status: available
]
Crew[
name: Why Les id: C 3 classification: Trained
points: 24 status: available
]
Crew[
name: Java I. S. Cool id: T 05 classification: Experienced
points: 42 status: available
]
]
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 4
Enter Ship id >> OOF
No Ship with that id was found
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 4
Enter Ship id >> T 01
Here is the single ship information
Ship[
id: T 01 purpose: Tour Bus status: on task
Here is the list of Crew
Crew[
name: Fastus Driverius id: D 4 classification: Experienced
points: 67 status: task assigned
]
]
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 5
Enter Crew id >> T 05
Here is the information about the Crew member
Crew[
name: Java I. S. Cool id: T 05 classification: Experienced
points: 42 status: available
]
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 6
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 2
Enter Ship id >> T 01
This Ship cannot be assigned a task as its status is on task
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 2
Enter Ship id >> A 10
Enter total points required >> 200
There is not enough experience in this Crew for the requested task
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 2
Enter Ship id >> T 01
This Ship cannot be assigned a task as its status is on task
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 3
Enter Ship id >> T 01
Ship damaged [y/n] ? n
Award bonus points [y/n] n
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 1
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 4
Enter Ship id >> T 01
Here is the single ship information
Ship[
id: T 01 purpose: Tour Bus status: available
Here is the list of Crew
Crew[
name: Fastus Driverius id: D 4 classification: Experienced
points: 77 status: available
]
]
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 6
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 6
Enter Ship id >> T 01
Enter Crew id >> D 4
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 6
Enter Ship id >> T 01
Enter Crew id >> D 5
Enter Crew name >> Guide Dus
Enter experience points >> 0
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 1
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 4
Enter Ship id >> T 01
Here is the single ship information
Ship[
id: T 01 purpose: Tour Bus status: available
Here is the list of Crew
Crew[
name: Fastus Driverius id: D 4 classification: Experienced
points: 77 status: available
]
Crew[
name: Guide Dus id: D 5 classification: Trainee
points: 0 status: available
]
]
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 3
Here is the list of Crew only
Crew[
name: Carl Tonius id: HE 01 classification: Experienced
points: 45 status: available
]
Crew[
name: Mister Scott id: E 100 classification: Specialist
points: 110 status: available
]
Crew[
name: Fastus Driverius id: D 4 classification: Experienced
points: 77 status: available
]
Crew[
name: Guide Dus id: D 5 classification: Trainee
points: 0 status: available
]
Crew[
name: Comp Gen id: T 02 classification: Trainee
points: 19 status: available
]
Crew[
name: Why Les id: C 3 classification: Trained
points: 24 status: available
]
Crew[
name: Java I. S. Cool id: T 05 classification: Experienced
points: 42 status: available
]
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 2
Here is the Ship only information
Ship[
id: A 10 purpose: Heavy Engineering status: available
Ship[
id: T 01 purpose: Tour Bus status: available
Ship[
id: IT 15 purpose: IT and Comms status: damaged
SpaceCity Display Menu
1. Display All
2. Display Ships only
3. Display All Crew only
4. Display Single Ship
5. Display Single Crew
6. Return to main menu
Enter display choice >> 6
SpaceCity Main Menu
1. Display Menu
2. Add Task
3. End Task
4. Change Ship Status
5. Add Ship
6. Add Crew
7. Save
8. Exit
Enter choice >> 8
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.