Question
import staticArray.ArrayList; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Scanner; import javax.swing.text.html.HTMLDocument.Iterator; import java.io.*; public class Restaurant { static String [] names = {Jones, Smith,
import staticArray.ArrayList; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Scanner;
import javax.swing.text.html.HTMLDocument.Iterator;
import java.io.*;
public class Restaurant { static String [] names = {"Jones", "Smith", "Brady", "Albertson", "McDougal", "McDonald", "Adams", "Billington", "Grevey", "Hayes", "Porter", "Walton", "Woods", "Jordan", "Powell", "Zeaoma", "Xung" };
static ArrayList
static final String FILENAME = "lunchOrders.dat"; static final String FILENAME2 = "alllunchOrders.dat"; /* * create two Iterators * verify the work independently * => create iterator #1 * display half of the objects using next() * => create iterator #2 * display all the objects using next() * => display the 2nd half of iterator #1 objects using next() */ public static void testIterators() { //to do } public static void mainMenu() { Scanner input = new Scanner(System.in); while(true) { System.out.println("Menu"); System.out.println(" 1 ..create new Array of LunchOrders"); System.out.println(" 2 ..add 10 entries to the Array of LunchOrders"); System.out.println(" 3 ..display array"); System.out.println(" 4 ..sort on order#"); System.out.println(" 5 ..sort on customer"); System.out.println(" 6 ..sort on cost"); System.out.println(" 7 ..save individual objects to a file"); System.out.println(" 8 ..restore individual objects from a from file"); System.out.println(" 9 ..save ArrayList object to a file"); System.out.println("10 ..restore ArrayList object from a from file"); System.out.println("11 ..test clone"); System.out.println("12 ..test iterators"); System.out.println("20 ..exit"); int choice=input.nextInt(); if (choice == 1 || choice == 2) { if (choice == 1) myOrders = new ArrayList
public static void main(String[] args) { mainMenu(); } public static void displayOrders() { System.out.println(LunchOrder.getHdr()); for (LunchOrder ord : myOrders) System.out.println(ord); }
}
how to finish the code where comments " to do"?
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