Commit 5b70b385 authored by ethan's avatar ethan

File upload

parent 5e69f3ef
...@@ -54,7 +54,7 @@ Start ...@@ -54,7 +54,7 @@ Start
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
Errors/things that still need finishing: Errors/things that still need finishing:
- after initial run - menu and seating array runs multiple times - loops itself? - after initial run/loop the menu and seating run multiple times
- make code choose next available seat if option is chosen - make code choose next available seat if option is chosen
- remove items method doesnt remove items - remove items method doesnt remove items
- make it empty basket after purchase - make it empty basket after purchase
...@@ -261,6 +261,7 @@ public class bookingSystem { ...@@ -261,6 +261,7 @@ public class bookingSystem {
itemPrice.add((float) 2.00); itemPrice.add((float) 2.00);
itemQty.add(20); itemQty.add(20);
System.out.println( "Code \t: Name \t\t: Price \t: Qty" ); System.out.println( "Code \t: Name \t\t: Price \t: Qty" );
for( int i=0; i< itemName.size(); i++ ) { for( int i=0; i< itemName.size(); i++ ) {
...@@ -290,6 +291,9 @@ public class bookingSystem { ...@@ -290,6 +291,9 @@ public class bookingSystem {
break; break;
} }
else { else {
//Converts from item code to the position of it in the array
tempItemCode = tempItemCode - 1;
//Asks for quantity //Asks for quantity
System.out.println("How many would you like to order?"); System.out.println("How many would you like to order?");
tempItemQty = input.nextInt(); tempItemQty = input.nextInt();
...@@ -428,7 +432,7 @@ public class bookingSystem { ...@@ -428,7 +432,7 @@ public class bookingSystem {
//Adds input items to the basket //Adds input items to the basket
private static void addItem(int tempItemCode, int tempItemQty) { private static void addItem(int tempItemCode, int tempItemQty) {
basketCode.add(tempItemCode); basketCode.add(tempItemCode + 1);
basketName.add(itemName.get(tempItemCode)); basketName.add(itemName.get(tempItemCode));
basketQty.add(tempItemQty); basketQty.add(tempItemQty);
basketPrice.add(tempItemQty * itemPrice.get(tempItemCode)); basketPrice.add(tempItemQty * itemPrice.get(tempItemCode));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment