Question: With our ship nearly fully upgraded, we decide that our cargo hold could be even more efficient. We make our way back to our home

With our ship nearly fully upgraded, we decide that our cargo hold could be even more efficient. We make our way back to our home station to speak with our friend in the engineering department again. After a long voyage home, we arrive. After docking our ship, we make our way to the center of the station. After arriving at the engineering department, we ask if there are any more modifications that can be done to our ship. He says that there is only one more available modification to the cargo bay and agrees to install it for us, for a price of course. Being low on credits, we venture back out into space to plunder some loot. After holding a few ships for ransom, we return to the station, sell our loot and return to the engineering department. After paying our credits, he begins work on our ships cargo bay. After being assured this new enhancement is the most efficient way of storage so far, we contently return to space to make our living as a feared space pirate.

- We can carry an unlimited number of items, as long as they dont exceed the maximum weight of the cargo bay, 25 Tons. (Use an Linked List that checks an items weight before placing it in the cargo hold).

- We must use a file to store and load our data.

- Items have attributes such as Name, Weight, Value, Durability and ID. (Create an object called Item)

- We now classify our items by separating them into 3 distinct categories Equipable, Consumable or Weapon. (You must implement these 3 classes that are subclasses of Item and they must have at least 3 unique attributes in each subclass)

- The following methods still have the same requirements from the assignment previous to this one: Add, Remove, Search, Sort, Filter, Display, and Ransack

You must use a LinkedList for storage, and you CANNOT use the LinkedList that is built into Java. You absolutely MUST use your own LinkedList created from the notes given in Lecture 8. Your code should not contain any Arrays or ArrayLists. Violation of this will result in an immediate 0 for this final project.

Note: With your submission of this assignment you must include all of your files AND an export of your database that I can easily load and test your program

Creating a Linked List Example:

Scanner scanner = new Scanner(System.in);

Node start, tail, next;

start = null;

int number = scanner.nextInt();

if (number > 0) {

start = new Node(number, null);

tail = start;

//get more numbers

while (true) {

number = scanner.nextInt();

if (number <= 0) break;

next = new Node(number, null);

tail.setNext(next);

tail = next;

}

}

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!