Where does the code keep track of the reservations?
I wouldn't think a seat was the same as a reservation. The use of a seat is reserved and that info keep as a reservation. The seat stays, reserved or not. A property of a seat would be that it was reserved.
To delete a reservation would be to change the seat's reserved property.
The method would need a reference to the seat to be able to change its contents.
80 in the first one and 15 in the second one, how does the method makeEmpty know what seat to make empty when the call in 80 on the first file does not pass a value
posted 4 years ago
how does the method makeEmpty know what seat to make empty
The makeEmpty() method is in the Seat class. It changes the values for the one instance of the Seat class.
The code on line 80 uses a reference to an instance of the Seat class to call its makeEmpty() method.
Here's an expansion of line 80: