Actors in Movie Ticket Machine:

1.      Customer

2.      Manager

3.      Ticket Machine

 

Interactions in Movie Ticket Machine:

Customer:

1.      Request number of tickets

2.      Enter money

3.      Get change back

Manager: (we will talk about these interactions in a later lab)

4.      Change movie title                         

5.      Change price

6.      Remove money and reset machine

 

Use cases:

           

Use case: Enter money

Actors: Customer, Ticket Machine

1.      Customer enters money into the movie ticket machine

2.      Ticket Machine accepts the money and adds them to the customer balance

 

Use case:  Request number of tickets

Actors: Customer, Ticket Machine

1.      Customer enters number of tickets

2.      Ticket Machine calculates the total cost of the tickets

3.      Ticket Machine subtracts cost of tickets from customer balance

4.      Ticket Machine adds total cost of tickets to total cash

5.      Ticket Machine subtracts number of tickets sold from number of seats available in theater.

6.      Ticket Machine determines the change due to customer

Alternative: At step 1, customer requests more tickets than seats left in the theater.

Print message: “Sorry, movie is sold out.”

Alternative: At step 3, total cost of tickets is more than the amount of money the customer input into the machine

Print message: “The total cost of your tickets is $XX.XX, but you only entered $X.XX. Please insert more money or request fewer tickets.”

Repeat step 3

 

Use case: Get change back

Actors: Customer, Ticket Machine

1.      Customer requests change back.

2.      Ticket machine returns the change to the customer.

3.      Ticket machine sets customer balance to zero.