After creating an Auditorium object:
listOfAllShows --> {Show(date(0, 0, 0), cost == random number)}
One Show object is created.
Now let's call your first version of Auditorium::AddShow, and let's assume
the user entered 200 for the cost and 1, 2, 3 for the date:
1) Assign new cost to the first object in the list
listOfAllShows --> {Show(date(0, 0, 0), cost == 200)}
2) Now create a new object given the new date
listOfAllShows --> {Show(date(1, 2, 3), cost == random number), Show(date(0, 0, 0), cost == 200)}
Calling CancelReservation
Display the cost of the first Show in the list:
iter2 --> Show(date(1, 2, 3), cost == random number)
iter2->getCost() == random number
Now let's say you changed AddShow first to push to the front a new object.
Again, let's use 200 for the cost and 1, 2, 3 for the date.
1) Create a new object given the new date
listOfAllShows --> {Show(date(1, 2, 3), cost == random number), Show(date(0, 0, 0), cost == random number)}
2) Now assign new cost to the first object in the list
listOfAllShows --> {Show(date(1, 2, 3), cost == 200), Show(date(0, 0, 0), cost == random number)}
Calling CancelReservation
Display the cost of the first Show in the list:
iter2 --> Show(date(1, 2, 3), cost == 200)
iter2->getCost() == 200
|