John Kim 6 lat temu
rodzic
commit
ef023f198e
2 zmienionych plików z 7 dodań i 1 usunięć
  1. BIN
      .DS_Store
  2. 7
    1
      TicketMachine.java

BIN
.DS_Store Wyświetl plik


+ 7
- 1
TicketMachine.java Wyświetl plik

@@ -17,6 +17,7 @@ public class TicketMachine
17 17
     private int balance;
18 18
     // The total amount of money collected by this machine.
19 19
     private int total;
20
+    private int status;
20 21
 
21 22
     /**
22 23
      * Create a machine that issues tickets of the given price.
@@ -25,7 +26,7 @@ public class TicketMachine
25 26
      */
26 27
     public TicketMachine(int ticketCost)
27 28
     {
28
-        price = ticketCost;
29
+        int price = ticketCost;
29 30
         balance = 0;
30 31
         total = 0;
31 32
     }
@@ -46,6 +47,11 @@ public class TicketMachine
46 47
     {
47 48
         return balance;
48 49
     }
50
+    
51
+    public int getTotal()
52
+    {
53
+        return total;
54
+    }
49 55
 
50 56
     /**
51 57
      * Receive an amount of money in cents from a customer.