Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need a help with this one FoodListInterface.java specifies a Java interface for an ADT that maintains a list of foods, dishes or meals. This interface

Need a help with this one

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 foodList package 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 ArrayList methods 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:

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

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions