Question
2. [12 points] Implement the FileManager class. Methods in this class are static and the class has no fields. We will not create objects of
2. [12 points] Implement the FileManager class. Methods in this class are static and the class has no fields. We will not create objects of this class, but use its static methods. In UML diagrams, static methods (and static variables) are underlined. FileManager class has methods for reading and writing files. See the figure below. The following method public static ArrayList
3. [18 points] Class MenuItem is defined as the superclass for Appetizer, Entree, Side, and Beer (all these 4 classes extend MenuItem). As a result, the fields and getters/setters previously defined are moved to MenuItem. See the following diagram. Implement the class MenuItem. Make Appetizer, Entree, Side, and Beer classes extend MenuItem (as indicated in the figure) and remove from them all fields and Getters/Setters. The fields name, description, calories are now inherited. Add the field price and the corresponding getter and setter in the class MenuItem. Now all other classes extending MenuItem also inherit price. In all classes Appetizer, Entree, Side, and Beer make constructors to receive all field values and to call the super constructor. Override toString() in MenuItem in order to return the name attribute. Also, override toString() in class Menu (this class is defined in previous Assignment 4) in order to return the name of the menu. 4. [15 points] Implement the class MenuManager. A MenuManager object has an ArrayList of each of the type of dishes.
The constructor, as you can see in the following figure, receives a fileName. Read this file using the method readItems of the class FileManager and fill a single ArrayList of MenuItem. Now we need to separate the single ArrayList containing MenuItem objects into the four ArrayList of different types. To solve this, create the four ArrayList and implement a loop go through the single ArrayList
[Optional: extra credit] Methods minCaloriesMenu() and maxCaloriesMenu() generates the lowest and highest calories menus, respectively. To do the minimum, you have to pick the Entree with the lowest calorie value among entrees. Same for appetizer, side and beer. The method maxCaloriesMenu() do similarly, but selecting highest calories dishes. Add getters and setters to all fields in MenuManager.
5. [45 points] Graphical User Interface. Build the following GUI. FIGURE 1. Main window implemented in class MenuManagerGUI
FIGURE 2. Secondary window for displaying the details of a Menu, also implemented in MenuManagerGUI class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started