Skip to content

Instantly share code, notes, and snippets.

@aahung
Created December 14, 2015 18:55
Show Gist options
  • Save aahung/523555e74aeaa32e71ac to your computer and use it in GitHub Desktop.
Save aahung/523555e74aeaa32e71ac to your computer and use it in GitHub Desktop.
SECTION A - 1
class RECEIPT {
// a)
int receiptInt;
String tableStr;
// b)
private ArrayList<Item> orderedItemList;
public getItemList() { return orderedItemList; }
public setItemList(ArrayList<Item> list) { orderedItemList = list; }
// c) In fact I have no idea how to do this one
int lastReceipt = 101;
// d)
public RECEIPT() {
receiptInt = lastReceipt + 1;
lastReceipt++;
}
// e)
public RECEIPT(int _receiptInt) {
receiptInt = _receiptInt;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment