diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..a55e7a1
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index be0d272..45c2f81 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -16,6 +16,7 @@
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 9d4feb8..7fefb1f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,12 +1,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
@@ -17,48 +17,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
@@ -216,18 +170,18 @@
-
-
+
+
-
+
-
+
-
+
@@ -241,6 +195,14 @@
+
+
+
+
+
+
+
+
@@ -257,22 +219,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -318,20 +264,21 @@
+
-
-
+
+
+
-
@@ -388,14 +335,9 @@
-
-
-
- 1540834598867
-
-
-
- 1540834598867
+
+
+
1541171733267
@@ -733,7 +675,14 @@
1549579063331
-
+
+ 1549989796852
+
+
+
+ 1549989796853
+
+
@@ -748,7 +697,7 @@
-
+
@@ -761,9 +710,8 @@
-
-
+
@@ -772,12 +720,12 @@
-
+
-
+
@@ -872,7 +820,6 @@
-
@@ -897,30 +844,10 @@
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1305,17 +1232,10 @@
-
-
-
-
-
-
-
-
-
+
+
@@ -1323,17 +1243,57 @@
+
+
+
+
+
+
+
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Q3/02152019/02152019.iml b/Q3/02152019/02152019.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/Q3/02152019/02152019.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Q3/02152019/CookieOrder.java b/Q3/02152019/CookieOrder.java
new file mode 100644
index 0000000..8beda6e
--- /dev/null
+++ b/Q3/02152019/CookieOrder.java
@@ -0,0 +1,20 @@
+public class CookieOrder {
+ private String variety;
+ private int numBoxes;
+
+ /** Constructs a new CookieOrder object. */
+ public CookieOrder(String variety, int numBoxes) {
+ this.variety = variety;
+ this.numBoxes = numBoxes;
+ }
+ /** @return the variety of cookie being ordered
+ */
+ public String getVariety() {
+ return variety;
+ }
+ /** @return the number of boxes being ordered
+ */
+ public int getNumBoxes() {
+ return numBoxes;
+ }
+}
\ No newline at end of file
diff --git a/Q3/02152019/MasterOrder.java b/Q3/02152019/MasterOrder.java
new file mode 100644
index 0000000..4a1e997
--- /dev/null
+++ b/Q3/02152019/MasterOrder.java
@@ -0,0 +1,51 @@
+import java.util.ArrayList;
+import java.util.List;
+
+public class MasterOrder {
+ /** The list of all cookie orders */
+ private List orders;
+ /** Constructs a new MasterOrder object. */
+ public MasterOrder() {
+ orders = new ArrayList();
+ }
+ /** Adds theOrder to the master order.
+ * @param theOrder the cookie order to add to the master order
+ */
+ public void addOrder(CookieOrder theOrder) {
+ orders.add(theOrder);
+ }
+ /** @return the sum of the number of boxes of all of the cookie orders
+ */
+ public int getTotalBoxes() {
+ int count = 0;
+ for(CookieOrder c : orders) count += c.getNumBoxes();
+ return count;
+ }
+
+ /** Removes all cookie orders from the master order that have the same variety of
+ * cookie as cookieVar and returns the total number of boxes that were removed.
+ * @param cookieVar the variety of cookies to remove from the master order
+ * @return the total number of boxes of cookieVar in the cookie orders removed
+ */
+ public int removeVariety(String cookieVar) {
+ int count = 0;
+
+ for(int i = 0; i < orders.size(); i++) {
+ if(orders.get(i).getVariety().equals(cookieVar)) {
+ count += orders.get(i).getNumBoxes();
+ orders.remove(i);
+ i--;
+ }
+ }
+
+ return count;
+ }
+
+ public void printAllOrders() {
+ for(CookieOrder each : orders) {
+ System.out.println("\nVariety: " + each.getVariety());
+ System.out.println("NumBoxes: " + each.getNumBoxes());
+ }
+ }
+ // There may be instance variables, constructors, and methods that are not shown.
+}
\ No newline at end of file
diff --git a/Q3/02152019/Runner.java b/Q3/02152019/Runner.java
new file mode 100644
index 0000000..271d3d9
--- /dev/null
+++ b/Q3/02152019/Runner.java
@@ -0,0 +1,19 @@
+public class Runner {
+ public static void main(String args[]) {
+ MasterOrder goodies = new MasterOrder();
+ goodies.addOrder(new CookieOrder("Chocolate Chip", 1));
+ goodies.addOrder(new CookieOrder("Shortbread", 5));
+ goodies.addOrder(new CookieOrder("Macaroon", 2));
+ goodies.addOrder(new CookieOrder("Chocolate Chip", 3));
+
+ goodies.printAllOrders();
+
+ System.out.println("\nTotal Orders: " + goodies.getTotalBoxes());
+
+ System.out.println("\nRemoving Macaroon: " + goodies.removeVariety("Macaroon"));
+
+ goodies.printAllOrders();
+
+ System.out.println("\nTotal Orders: " + goodies.getTotalBoxes());
+ }
+}
\ No newline at end of file