Travel Agency – Data Structures Exercise

A travel agency has advertised a massive price drop for all summer holiday destinations. To avail of the offer, customers have to dial in and place a reservation over the phone. The agency’s telephone system is managed by a single sales agent. When the sales agent is busy talking to a customer, other potential customers are dialling in. In order not to lose these customers a robot asks the customers to give a few personal details and to hold the line. Each customer has to give their name and the budget in Euro per person they are willing to spend. The system is built so that customers willing to spend more are served first. When the number of waiting customers is higher than 5, the sales agent is informed to speed up the discussion as some of the waiting customers may become impatient and drop the call.

A GUI implementation of such application should allow to:

  • input the details of a new waiting customer and alert the agent when the number of waiting customers is higher than 5;
  • printout the number of waiting customers and each waiting customer’s details;
  • accept the call of the next waiting customer (i.e. the one allocating the highest travel budget), and printout his/her name.

It is necessary to:

  • Identify the Data Structure to be used as a solution to store the waiting customers.
  • Design and develop a suitable GUI for the application
  • Implement a Java application that solves the problem, making use of the identified data structure. Test the application to make sure it works correctly.

TravelAgencyTester

 

MyPriorityQueue

 

 PQInterface

 

PQElement

 

TraveAgencyGUI

 

TravelAgencyGUI.form

 

 

 

 

 

Tagged: