Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

LunchOrder The goal of this is to: Create an object which supports the Comparabl

ID: 3736687 • Letter: L

Question

LunchOrder

The goal of this is to:

Create an object which supports the Comparable, Serializable, and Cloneable interfaces.

Be able to sort an ArrayList of objects implementing the Comparable interface.

Be able to clone LunchOrder objects and to understand the difference between a reference copy and a “full” copy.   

Explore how to save and restore Objects to/from a file.

Create and use multiple Iterators.

ArrayList

Modify the ArrayList class in staticArray:

implement Iterable<T>

private Iterator class

implement Serializable

add clear() : set all elements to null and reset the next field.

implement a sort() method

selection sort   (Sorting method will fall later in the semester)

  

LunchOrder

Create a LunchOrder class with the following fields:

String name

int orderNumber

int number of burgers

int number of fries

int number of sodas

Date created; reference to a java.util.Date object.

static int nextOrderNumber

static int comparisonMethod

In addition, define constants for the cost of a burger (2.75), fries (.75), and soda (1.50).

Note: all fields should be defined as private or protected unless there is a good reason to do otherwise.

The LunchOrder will implement the following interfaces: Comparable, Cloneable, and Serializable.

We will be able to support sorting LunchOrders based on 3 different criteria: order number, customer’s name, and cost of the order. To do so, the LunchOrder will need the following constants to support different ways to compare LunchOrders:

based on ID

based on customer’s name

based on the cost of an order

LunchOrder methods

double computeOrderCost(): you will be passed two doubles for the tax and tip rates. Compute the cost based on the Cost per item, the number of items, the tax and tip based on the subtotal.

int compareTo(): LunchOrder objects will be compared based on the comparison indicator (ID, name, cost of order). This method is defined in the Comparable interface.

clone(): copy of item using the Object’s clone method and then make of a copy of the Date object reference by the dateCreated field. This method is defined in the Cloneable interface.

toString(): display the name, id, number of items, order cost, and the date Created field.

a static method to display the header for the toString() method.

accessors where needed.

Restaurant application.

Modify Restaurant.java, this is the application code.

Complete the following test methods:

testIterators(): create 2 Iterators. Display the first 3 orders of the 1st iterator, then display all the orders of the 2nd iterator, and then display the rest of the elements with the 1st iterators. This is to show the independence of each iterator.  

testCloneMethod(): first implement the LunchOrder’s clone method to just call the Object’s clone method. After cloning a specific object, verify when you modify the Date field (using getTime() and setTime()), it changes both the original and cloned objects. Then modify the LunchOrder’s clone method so that it creates a new Date object with the same value of the original order. Verify when you modify the clone’s Date field, it does not change the original object’s Date field.

In addition, you will modify code within the mainMenu() to:

save and restore all LunchOrder objects to a file called lunchOrder.dat

save and restore the ArrayList of LunchOrder objects to a filed called arrayLunchOrderObjects.dat.

Display of Application:

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

1

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

3

NOTE: We created 10 LunchOrders after we created the array. Each element is displayed via a call to the toString() method. The static method, getHdr() returns the corresponding header for the display.

   customer order# #Burgs #Fries #Sodas    cost

     Jordan     100       9       7       9   52.20 Fri Oct 14 22:45:56 EDT 2016

     Porter     101       1       5       2   11.40 Fri Oct 14 22:45:56 EDT 2016

       Xung     102       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

     Zeaoma     103       3       9       0   18.00 Fri Oct 14 22:45:56 EDT 2016

   McDougal     104       7       2       1   26.70 Fri Oct 14 22:45:56 EDT 2016

     Powell     105      4       1       7   26.70 Fri Oct 14 22:45:56 EDT 2016

      Hayes     106       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

       Xung     107       1       7       3   15.00 Fri Oct 14 22:45:56 EDT 2016

   McDougal     108       3       2       2   15.30 Fri Oct 14 22:45:56 EDT 2016

   McDougal     109       1       9       0   11.40 Fri Oct 14 22:45:56 EDT 2016

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

5

Note: The LunchOrder’s static method, setCompareOrder(1), is called to compare orders based on the cutomer’s name.

   customer order# #Burgs #Fries #Sodas    cost

      Hayes     106       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

     Jordan     100       9       7       9   52.20 Fri Oct 14 22:45:56 EDT 2016

   McDougal     104       7       2       1   26.70 Fri Oct 14 22:45:56 EDT 2016

   McDougal     108       3       2       2   15.30 Fri Oct 14 22:45:56 EDT 2016

   McDougal     109       1       9       0   11.40 Fri Oct 14 22:45:56 EDT 2016

     Porter     101       1       5       2   11.40 Fri Oct 14 22:45:56 EDT 2016

     Powell     105       4       1       7   26.70 Fri Oct 14 22:45:56 EDT 2016

       Xung     102       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

       Xung     107       1       7       3   15.00 Fri Oct 14 22:45:56 EDT 2016

     Zeaoma     103       3       9       0   18.00 Fri Oct 14 22:45:56 EDT 2016

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

6

Note: The LunchOrder’s static method, setCompareOrder(1), is called to compare orders based on the customer’s order cost.

   customer order# #Burgs #Fries #Sodas    cost

   McDougal     109       1       9       0   11.40 Fri Oct 14 22:45:56 EDT 2016

     Porter     101       1       5       2   11.40 Fri Oct 14 22:45:56 EDT 2016

       Xung     107       1       7       3   15.00 Fri Oct 14 22:45:56 EDT 2016

   McDougal     108       3       2       2   15.30 Fri Oct 14 22:45:56 EDT 2016

     Zeaoma     103       3       9       0   18.00 Fri Oct 14 22:45:56 EDT 2016

      Hayes     106       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

       Xung     102       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

   McDougal     104       7       2       1   26.70 Fri Oct 14 22:45:56 EDT 2016

     Powell     105       4       1       7   26.70 Fri Oct 14 22:45:56 EDT 2016

     Jordan     100       9       7       9   52.20 Fri Oct 14 22:45:56 EDT 2016

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

4

Note: The LunchOrder’s static method, setCompareOrder(1), is called to compare orders based on the customer’s order number.

   customer order# #Burgs #Fries #Sodas    cost

     Jordan     100       9       7       9   52.20 Fri Oct 14 22:45:56 EDT 2016

     Porter     101       1       5       2   11.40 Fri Oct 14 22:45:56 EDT 2016

       Xung     102       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

     Zeaoma     103       3       9       0   18.00 Fri Oct 14 22:45:56 EDT 2016

   McDougal     104       7       2       1   26.70 Fri Oct 14 22:45:56 EDT 2016

     Powell     105       4       1       7   26.70 Fri Oct 14 22:45:56 EDT 2016

      Hayes     106       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

       Xung     107       1       7       3   15.00 Fri Oct 14 22:45:56 EDT 2016

   McDougal     108       3       2       2   15.30 Fri Oct 14 22:45:56 EDT 2016

   McDougal     109       1       9       0   11.40 Fri Oct 14 22:45:56 EDT 2016

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

7

Note: All LunchOrders are saved via an enhanced for loop to a file named lunchOrder.dat.

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

2

Note: additional entries are added to the ArrayList – we want to modify the Array list before restoring it to the original contents we saved to a file.

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

5

Note: ArrayList is sorted based on customer’s name

   customer order# #Burgs #Fries #Sodas    cost

Albertson     118       8       3       3   34.50 Fri Oct 14 22:47:35 EDT 2016

      Brady     112       8       3       7   41.70 Fri Oct 14 22:47:35 EDT 2016

     Grevey     113       7       2       0   24.90 Fri Oct 14 22:47:35 EDT 2016

      Hayes     106       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

      Hayes     110       8       2       6   39.00 Fri Oct 14 22:47:35 EDT 2016

      Hayes    117       9       7       4   43.20 Fri Oct 14 22:47:35 EDT 2016

      Jones     114       1       7       5   18.60 Fri Oct 14 22:47:35 EDT 2016

      Jones     115       5       7       9   39.00 Fri Oct 14 22:47:35 EDT 2016

     Jordan     100      9       7       9   52.20 Fri Oct 14 22:45:56 EDT 2016

   McDonald     119       2       8       3   19.20 Fri Oct 14 22:47:35 EDT 2016

   McDougal     104       7       2       1   26.70 Fri Oct 14 22:45:56 EDT 2016

   McDougal     108       3       2       2   15.30 Fri Oct 14 22:45:56 EDT 2016

   McDougal     109       1       9       0   11.40 Fri Oct 14 22:45:56 EDT 2016

     Porter     101       1       5       2   11.40 Fri Oct 14 22:45:56 EDT 2016

     Powell     105       4       1       7   26.70 Fri Oct 14 22:45:56 EDT 2016

      Smith     116       8       1       7   39.90 Fri Oct 14 22:47:35 EDT 2016

     Walton     111       7       8       9   46.50 Fri Oct 14 22:47:35 EDT 2016

       Xung     102       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

       Xung     107       1       7       3   15.00 Fri Oct 14 22:45:56 EDT 2016

     Zeaoma     103       3       9       0   18.00 Fri Oct 14 22:45:56 EDT 2016

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

8

ArrayList is restored from a file, therefore we go back to the original 10 items we saved in the order that they were in (based on order number).

Note: you need to repeat the save/restore saving the ArrayList as an object. 1 call to writeObject, as opposed to 10 calls above.

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

3

   customer order# #Burgs #Fries #Sodas    cost

     Jordan     100       9       7       9   52.20 Fri Oct 14 22:45:56 EDT 2016

     Porter     101       1       5       2   11.40 Fri Oct 14 22:45:56 EDT 2016

       Xung     102       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

     Zeaoma     103       3       9       0   18.00 Fri Oct 14 22:45:56 EDT 2016

   McDougal     104       7       2       1   26.70 Fri Oct 14 22:45:56 EDT 2016

     Powell     105       4       1       7   26.70 Fri Oct 14 22:45:56 EDT 2016

      Hayes     106       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

       Xung     107       1       7       3   15.00 Fri Oct 14 22:45:56 EDT 2016

   McDougal     108       3       2       2   15.30 Fri Oct 14 22:45:56 EDT 2016

   McDougal     109       1       9       0   11.40 Fri Oct 14 22:45:56 EDT 2016

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

11

Note: The 1st element of the ArrayList is cloned and displayed. Then modify the clone method so that a new Date object is created in the clone method. When the cloned object’s dateCreated object is modified, the original object’s field is not modified.

get(0) clone:      Jordan     100       9       7       9   52.20 Fri Oct 14 22:45:56 EDT 2016

get(0) order1:      Jordan     100       9       7       9   52.20 Fri Oct 14 22:45:56 EDT 2016

get(0) order2:      Jordan     100       9       7       9   52.20 Thu Oct 13 22:45:56 EDT 2016

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

12

Note: 2 Iterators are created. We display the first 3 elements of the first Iterator, then we display all items of the 2nd iterator, and finally, we display the rest of the elements of the 1st iterator. The Iterators are independent of each other.

     Jordan     100       9       7       9   52.20 Fri Oct 14 22:45:56 EDT 2016

     Porter     101       1       5       2   11.40 Fri Oct 14 22:45:56 EDT 2016

       Xung     102       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

-------------------

     Jordan    100       9       7       9   52.20 Fri Oct 14 22:45:56 EDT 2016

     Porter     101       1       5       2   11.40 Fri Oct 14 22:45:56 EDT 2016

     Zeaoma     103       3       9       0   18.00 Fri Oct 14 22:45:56 EDT 2016

   McDougal     104       7       2       1   26.70 Fri Oct 14 22:45:56 EDT 2016

     Powell     105       4       1       7   26.70 Fri Oct 14 22:45:56 EDT 2016

      Hayes     106       5       6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

       Xung     107       1      7       3   15.00 Fri Oct 14 22:45:56 EDT 2016

   McDougal     108       3       2       2   15.30 Fri Oct 14 22:45:56 EDT 2016

   McDougal     109       1       9       0   11.40 Fri Oct 14 22:45:56 EDT 2016

-------------------

     Zeaoma     103       3       9       0   18.00 Fri Oct 14 22:45:56 EDT 2016

   McDougal     104       7       2       1   26.70 Fri Oct 14 22:45:56 EDT 2016

     Powell     105       4       1       7   26.70 Fri Oct 14 22:45:56 EDT 2016

      Hayes     106       5      6       0   21.90 Fri Oct 14 22:45:56 EDT 2016

       Xung     107       1       7       3   15.00 Fri Oct 14 22:45:56 EDT 2016

   McDougal     108       3       2       2   15.30 Fri Oct 14 22:45:56 EDT 2016

   McDougal     109       1       9       0   11.40 Fri Oct 14 22:45:56 EDT 2016

Menu

1 ..create new Array of LunchOrders

2 ..add 10 entries to the Array of LunchOrders

3 ..display array

4 ..sort on order#

5 ..sort on customer

6 ..sort on cost

7 ..save individual objects to a file

8 ..restore individual objects from a from file

9 ..save ArrayList object to a file

10 ..restore ArrayList object from a from file

11 ..test clone

12 ..test iterators

20 ..exit

20

LunchOrder.java

Restaurant.java

  import java.io.Serializable;  import java.util.Date;    public class LunchOrder implements Comparable, Cloneable, Serializable {                    static final double COST_BURGERS = 2.75;          static final double COST_FRIES = .75;          static final double COST_SODAS = 1.50;                    private int numBurgers;          private int numFries;          private int numSodas;          private String customer;          private int orderNum;          private Date dateCreated;          static int nextOrderNum = 100;               //3 ways to sort LunchOrders: by orderNum, customer, and cost          private static int sortOrder = 0;               static final int SORT_ID = 0;          static final int SORT_CUSTOMER = 1;          static final int SORT_COST = 2;            public LunchOrder(String customer, int numBurgers, int numFries, int numSodas) {                  super();                  this.customer = customer;                  this.numBurgers = numBurgers;                  this.numFries = numFries;                  this.numSodas = numSodas;                  orderNum = nextOrderNum++;                  dateCreated = new Date();          }                    public int compareTo(Object order)          {                  //todo          }          public static void setCompareOrder( int num )          {                  sortOrder = num;          }          public Object clone() throws CloneNotSupportedException          {                  //todo     }          public double computeOrderCost( double tax, double tip)          {                  double subtotal =  numBurgers * COST_BURGERS +                                   numFries * COST_FRIES +                                   numSodas * COST_SODAS;                    double orderTip = subtotal * tip;                  double orderTax = subtotal * tax;                    return subtotal + orderTip + orderTax;          }          public Date getDateCreated()          {                  return dateCreated;          }                    public static String getHdr()          {                  String str = String.format(" %10s  %6s  %6s  %6s  %6s  %6s", "customer", "order#", "#Burgs", "#Fries", "#Sodas", "cost");                   return str;          }                    public String toString()          {                  String str = String.format(" %10s  %6d  %6d  %6d  %6d  %6.2f  %s", customer, orderNum, numBurgers, numFries, numSodas, computeOrderCost(.05, .15), dateCreated);                   return str;          }                }

Explanation / Answer

Restaurant.java

LunchOrder.java

Received Output:

Menu
1 ..create new Array of LunchOrders
2 ..add 10 entries to the Array of LunchOrders
3 ..display array
4 ..sort on order#
5 ..sort on customer
6 ..sort on cost
7 ..save individual objects to a file
8 ..restore individual objects from a from file
9 ..save ArrayList object to a file
10 ..restore ArrayList object from a from file
11 ..test clone
12 ..test iterators
20 ..exit
1
Menu
1 ..create new Array of LunchOrders
2 ..add 10 entries to the Array of LunchOrders
3 ..display array
4 ..sort on order#
5 ..sort on customer
6 ..sort on cost
7 ..save individual objects to a file
8 ..restore individual objects from a from file
9 ..save ArrayList object to a file
10 ..restore ArrayList object from a from file
11 ..test clone
12 ..test iterators
20 ..exit
2
Menu
1 ..create new Array of LunchOrders
2 ..add 10 entries to the Array of LunchOrders
3 ..display array
4 ..sort on order#
5 ..sort on customer
6 ..sort on cost
7 ..save individual objects to a file
8 ..restore individual objects from a from file
9 ..save ArrayList object to a file
10 ..restore ArrayList object from a from file
11 ..test clone
12 ..test iterators
20 ..exit
3
customer order# #Burgs #Fries #Sodas cost
Powell 100 4 6 2 22.20 Sun Mar 25 01:27:36 IST 2018
Jones 101 4 2 8 29.40 Sun Mar 25 01:27:36 IST 2018
McDougal 102 9 7 1 37.80 Sun Mar 25 01:27:36 IST 2018
McDougal 103 9 2 2 35.10 Sun Mar 25 01:27:36 IST 2018
Jones 104 10 1 4 41.10 Sun Mar 25 01:27:36 IST 2018
McDougal 105 1 9 6 22.20 Sun Mar 25 01:27:36 IST 2018
Albertson 106 1 1 1 6.00 Sun Mar 25 01:27:36 IST 2018
Porter 107 7 7 7 42.00 Sun Mar 25 01:27:36 IST 2018
Jones 108 6 9 7 40.50 Sun Mar 25 01:27:36 IST 2018
McDonald 109 1 0 4 10.50 Sun Mar 25 01:27:36 IST 2018
Powell 110 2 6 3 17.40 Sun Mar 25 01:27:39 IST 2018
Zeaoma 111 1 0 4 10.50 Sun Mar 25 01:27:39 IST 2018
Hayes 112 1 6 4 15.90 Sun Mar 25 01:27:39 IST 2018
McDonald 113 3 7 1 18.00 Sun Mar 25 01:27:39 IST 2018
Zeaoma 114 4 8 5 29.40 Sun Mar 25 01:27:39 IST 2018
Albertson 115 4 7 9 35.70 Sun Mar 25 01:27:39 IST 2018
Porter 116 8 2 9 44.40 Sun Mar 25 01:27:39 IST 2018
Porter 117 8 0 6 37.20 Sun Mar 25 01:27:39 IST 2018
Hayes 118 8 3 0 29.10 Sun Mar 25 01:27:39 IST 2018
Zeaoma 119 10 2 7 47.40 Sun Mar 25 01:27:39 IST 2018

Menu
1 ..create new Array of LunchOrders
2 ..add 10 entries to the Array of LunchOrders
3 ..display array
4 ..sort on order#
5 ..sort on customer
6 ..sort on cost
7 ..save individual objects to a file
8 ..restore individual objects from a from file
9 ..save ArrayList object to a file
10 ..restore ArrayList object from a from file
11 ..test clone
12 ..test iterators
20 ..exit
4
customer order# #Burgs #Fries #Sodas cost
Powell 100 4 6 2 22.20 Sun Mar 25 01:27:36 IST 2018
Jones 101 4 2 8 29.40 Sun Mar 25 01:27:36 IST 2018
McDougal 102 9 7 1 37.80 Sun Mar 25 01:27:36 IST 2018
McDougal 103 9 2 2 35.10 Sun Mar 25 01:27:36 IST 2018
Jones 104 10 1 4 41.10 Sun Mar 25 01:27:36 IST 2018
McDougal 105 1 9 6 22.20 Sun Mar 25 01:27:36 IST 2018
Albertson 106 1 1 1 6.00 Sun Mar 25 01:27:36 IST 2018
Porter 107 7 7 7 42.00 Sun Mar 25 01:27:36 IST 2018
Jones 108 6 9 7 40.50 Sun Mar 25 01:27:36 IST 2018
McDonald 109 1 0 4 10.50 Sun Mar 25 01:27:36 IST 2018
Powell 110 2 6 3 17.40 Sun Mar 25 01:27:39 IST 2018
Zeaoma 111 1 0 4 10.50 Sun Mar 25 01:27:39 IST 2018
Hayes 112 1 6 4 15.90 Sun Mar 25 01:27:39 IST 2018
McDonald 113 3 7 1 18.00 Sun Mar 25 01:27:39 IST 2018
Zeaoma 114 4 8 5 29.40 Sun Mar 25 01:27:39 IST 2018
Albertson 115 4 7 9 35.70 Sun Mar 25 01:27:39 IST 2018
Porter 116 8 2 9 44.40 Sun Mar 25 01:27:39 IST 2018
Porter 117 8 0 6 37.20 Sun Mar 25 01:27:39 IST 2018
Hayes 118 8 3 0 29.10 Sun Mar 25 01:27:39 IST 2018
Zeaoma 119 10 2 7 47.40 Sun Mar 25 01:27:39 IST 2018
Menu
1 ..create new Array of LunchOrders
2 ..add 10 entries to the Array of LunchOrders
3 ..display array
4 ..sort on order#
5 ..sort on customer
6 ..sort on cost
7 ..save individual objects to a file
8 ..restore individual objects from a from file
9 ..save ArrayList object to a file
10 ..restore ArrayList object from a from file
11 ..test clone
12 ..test iterators
20 ..exit
5
customer order# #Burgs #Fries #Sodas cost
Albertson 106 1 1 1 6.00 Sun Mar 25 01:27:36 IST 2018
Albertson 115 4 7 9 35.70 Sun Mar 25 01:27:39 IST 2018
Hayes 112 1 6 4 15.90 Sun Mar 25 01:27:39 IST 2018
Hayes 118 8 3 0 29.10 Sun Mar 25 01:27:39 IST 2018
Jones 101 4 2 8 29.40 Sun Mar 25 01:27:36 IST 2018
Jones 104 10 1 4 41.10 Sun Mar 25 01:27:36 IST 2018
Jones 108 6 9 7 40.50 Sun Mar 25 01:27:36 IST 2018
McDonald 109 1 0 4 10.50 Sun Mar 25 01:27:36 IST 2018
McDonald 113 3 7 1 18.00 Sun Mar 25 01:27:39 IST 2018
McDougal 102 9 7 1 37.80 Sun Mar 25 01:27:36 IST 2018
McDougal 103 9 2 2 35.10 Sun Mar 25 01:27:36 IST 2018
McDougal 105 1 9 6 22.20 Sun Mar 25 01:27:36 IST 2018
Porter 107 7 7 7 42.00 Sun Mar 25 01:27:36 IST 2018
Porter 116 8 2 9 44.40 Sun Mar 25 01:27:39 IST 2018
Porter 117 8 0 6 37.20 Sun Mar 25 01:27:39 IST 2018
Powell 100 4 6 2 22.20 Sun Mar 25 01:27:36 IST 2018
Powell 110 2 6 3 17.40 Sun Mar 25 01:27:39 IST 2018
Zeaoma 111 1 0 4 10.50 Sun Mar 25 01:27:39 IST 2018
Zeaoma 114 4 8 5 29.40 Sun Mar 25 01:27:39 IST 2018
Zeaoma 119 10 2 7 47.40 Sun Mar 25 01:27:39 IST 2018
Menu
1 ..create new Array of LunchOrders
2 ..add 10 entries to the Array of LunchOrders
3 ..display array
4 ..sort on order#
5 ..sort on customer
6 ..sort on cost
7 ..save individual objects to a file
8 ..restore individual objects from a from file
9 ..save ArrayList object to a file
10 ..restore ArrayList object from a from file
11 ..test clone
12 ..test iterators
20 ..exit
6
customer order# #Burgs #Fries #Sodas cost
Albertson 106 1 1 1 6.00 Sun Mar 25 01:27:36 IST 2018
Zeaoma 111 1 0 4 10.50 Sun Mar 25 01:27:39 IST 2018
McDonald 109 1 0 4 10.50 Sun Mar 25 01:27:36 IST 2018
Powell 110 2 6 3 17.40 Sun Mar 25 01:27:39 IST 2018
Zeaoma 114 4 8 5 29.40 Sun Mar 25 01:27:39 IST 2018
Powell 100 4 6 2 22.20 Sun Mar 25 01:27:36 IST 2018
McDougal 105 1 9 6 22.20 Sun Mar 25 01:27:36 IST 2018
McDonald 113 3 7 1 18.00 Sun Mar 25 01:27:39 IST 2018
Hayes 112 1 6 4 15.90 Sun Mar 25 01:27:39 IST 2018
Zeaoma 119 10 2 7 47.40 Sun Mar 25 01:27:39 IST 2018
Porter 117 8 0 6 37.20 Sun Mar 25 01:27:39 IST 2018
Porter 116 8 2 9 44.40 Sun Mar 25 01:27:39 IST 2018
Porter 107 7 7 7 42.00 Sun Mar 25 01:27:36 IST 2018
McDougal 103 9 2 2 35.10 Sun Mar 25 01:27:36 IST 2018
McDougal 102 9 7 1 37.80 Sun Mar 25 01:27:36 IST 2018
Jones 101 4 2 8 29.40 Sun Mar 25 01:27:36 IST 2018
Hayes 118 8 3 0 29.10 Sun Mar 25 01:27:39 IST 2018
Jones 108 6 9 7 40.50 Sun Mar 25 01:27:36 IST 2018
Jones 104 10 1 4 41.10 Sun Mar 25 01:27:36 IST 2018
Albertson 115 4 7 9 35.70 Sun Mar 25 01:27:39 IST 2018