homework作业 | java代做 | oop代做 | assignment代写 – 该题目是一个常规的oop的练习题目代写, 是比较有代表性的java/oop等代写方向, 该题目是值得借鉴的assignment代写的题目
Purpose: In this assignment you will build an application that will help the user plan a party by maintaining two lists: the list of guests and the list of food/drink items to be served. These lists will be sorted and will not allow duplicate entries (see lecture notes 4 for a description of such lists).
Objectives: a) Using Inheritance, b) Implementing an abstract class, c) generic programming.
The client application The application has a two level menu structure. The top menu lets the user choose which list (guest list or food list) the user wishes to work with, or to quit the application. Selecting a list presents a menu of operations that can be performed on the selected list (add, remove, find, print) or quit working on the list. The “Quit” option from this menu will return the user to the top level menu. When the application ends, it prints the final versions of the two lists on System.out.
Note: All user input is captured using the nextLine() method so multiple word names can be used (George Jones or Chicken Wings).
The generic abstract class SLND ( S orted L ist with N o D uplicates)
This class has one instance variable (intended for the client class to create a name for the list object public final ). This allows the client code to inform the user which list is being worked on and also print the list’s name when the list content is displayed. The class has 4 methods and all are declared abstract. See the design in the startup code file.
Completing the Client Code
The "main" method of the client class is provided. You just need to add your name in the right place. The "mainMenu" method provides the user with 3 choices (top level menu). Depending on the choice made by the user, the "maintain" method should be called with the appropriate list as the argument or the l oop should end. Complete the TODO here. The "maintain" method informs the user of the list s/he is working with and presents the user with the second level menu choices. Depending on the user's choice it calls a client side method to handle further interaction with the user and call the appropriate instance method from the SLND_ArrayList class. Complete the TODO here. The "add" method is complete. It shows you how to get further user interaction and calling appropriate class method. Use this to guide your completing the remaining client side methods. Methods "find" and "remove" : Complete these two methods using the "add" method for guidance.
Implementing the abstract class
The easiest way to implement this class (short of using the java library TreeSet class) is to use an ArrayList to hold the list contents. To add a new value you must first find out the correct index position to add the new value (in this process you can find out if the value already exists, in which case the method indicates failure). Then you can add the new value at the correct index position by using ArrayList class’s add method. To find a value (see if it exists in the Sorted List), you should use sequential or binary search. You are not allowed to use a library method for this operation. To remove a value, first find its index position, then remove it by calling the ArrayList class’s remove method that takes the index position as argument. Do not use the ArrayList class’s remove method that takes the value to be removed as the argument. The toString method can be implemented by a creating a string containing the name of the list concatenated with the list items. Add the end-of-line ( ‘\n’ ) character after each string, so printing the string would show the
list name followed by the item names, one per line of output. Add a line of hyphens (of the right length) after the name of the list (to set it off from the item names in the list). See sample output for guidance.
What to submit Submit a Word document with the complete code and screen shots showing what your program can do. You may need to submit several screen shots to show that everything works the way they are supposed to.