|
|
|
|
8
|
Work through all these exercises. You edit this file with your answers for these exercises.
|
8
|
Work through all these exercises. You edit this file with your answers for these exercises.
|
9
|
|
9
|
|
10
|
### Exercise 2.1
|
10
|
### Exercise 2.1
|
11
|
-* Create a TicketMachine object on the object bench.
|
|
|
12
|
-* Upon viewing its methods, `getBalance`, `getPrice`, `insertMoney`, `printTicket`.
|
|
|
|
|
11
|
+* Create a `TicketMachine` object on the object bench.
|
|
|
12
|
+* The following methods should be available upon invoking it from the object bench `getBalance`, `getPrice`, `insertMoney`, `printTicket`.
|
13
|
* Use `getPrice` method to view the value of the price of the tickets that was set when this object was created.
|
13
|
* Use `getPrice` method to view the value of the price of the tickets that was set when this object was created.
|
14
|
* Use `insertMoney` method to simulate inserting an amount of money into the machine.
|
14
|
* Use `insertMoney` method to simulate inserting an amount of money into the machine.
|
15
|
* Use `getBalance` to check that the machine has a record of the amount inserted.
|
15
|
* Use `getBalance` to check that the machine has a record of the amount inserted.
|