Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

FoodListInterface.java specifies a Java interface for an ADT that maintains a list of foods, dishes or meals. This interface includes two operations: add(String food) add

FoodListInterface.java specifies a Java interface for an ADT that maintains a list of foods, dishes or meals. This interface includes two operations:

  • add(String food) add the name of a food, dish or meal to the list
  • onTheMenu(String food) check if a given food item is on the list

Develop three implementations of this interface, each with a different underlying data structure:

  • Array
  • Linked list
  • ArrayList from the java.util package (a Java Collections Framework class)

Each implementation is a separate class, and each of these classes is to include a toString() method to list out the food items, one per line.

The source code for the interface is provided in the foodListpackage in the attached Eclipse project export file for this assignment. The linked list implementation must use the LLStringNode.java class provided in the foodList package; do not use the LinkedList class from the java.util package.

To earn full credit you must make use of appropriate ArrayListmethods to efficiently develop the food list ADT based on that data structure, along with an enhanced for loop to traverse the list of foods for the toString() method.

In addition to the three ADT classes, create a single Java program i.e., a Java class with a main() method to test each of the implementations. For each implementation:

  • Instantiate a list object and add seven of your favorite things to eat;
  • Using System.out.println(), display the list of food items;
  • Use the onThisList() method to test whether fettuccine alfredo is on your list, and report out the result; and
  • Use the onThisList() method to test another food, and report out that result make sure to use a food, dish or meal that produces the opposite result from the first test.

Submit the following items:

  • An Eclipse project export with all of your source code
  • Overall project description, as described in the Programming Projects General Requirements; note that simple .txt files are not acceptable

ProgProjOne.zip

ProgProjOneHeadStart.zip

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

What role do values play in a total quality setting?

Answered: 1 week ago