Starting from:

$35

PA6 Solution

In this PA, you are asked to develop a client software system for the Omega travel agency which supports Delta and Hilton. The Omega travel agency has three levels for its clients, i.e., gold (5000 points), silver ([2001,5000] points), and normal ([0,2000] points) according to a client’s point, an integer value, only associated with Omega. Initially, each client starts with 0 point. After travelling with the Delta Airlines, the system updates a client’s mileage, an integer value only associated with Delta, as follows: 1) Normal level: update the client’s total mileage by adding the actual travel mileage; 2) Silver level: update the client’s total mileage by doubling the actual travel miles; 3) Gold level: update the client’s total mileage by tripling the actual travel miles. After staying in a Hilton hotel, the system updates a client’s total (hotel) charge, a double/float value only associated with Hilton, as follows: 1) Normal level: update the client’s total hotel charge by adding (new charge * 100) ; 2) Silver level: update the client’s total charge by adding (new charge * 200); 3) Gold level: update the client’s total charge by adding (new charge * 300). Also, Delta and Hilton can deduce the mileage and total charge respectively via an appropriate amount as input. Once the mileage or total hotel charge is updated, the point with the Omega should be update accordingly. The conversions from mileage and total charge to points are point = mileage /5 and point = total charge / 10.

In your design, you should have an interface for Delta, Hilton and Omega. Some new requirements will be added based on the following scenario:

A new level of a client can be introduced such as the executive level. Therefore, Delta and Hilton will have a new calculation rule to update mileage and total (hotel) charge respectively. In this case, your design should satisfy the open-close principle.
Your design/implementation should fulfill the following requirements:

Once a client object is created, you cannot delete the object. For instance, if a client object is created for John, you can create another client object for John when his level is changed.
Once an update of points is changed, your program should output the change of points as well as its root cause, i.e., either the change of mileage or total charge, using a console.
Use a console to ask a client whether a mileage or total hotel charge is provided until “$” is met, indicating the stop of your program.
The input of the mileage and total charge is implemented by the client interface but the client interface only provides the method to query the point BUT NOT the mileage and total hotel charge.
Also, The Omega travel agency decides to apply the façade pattern to provide a simple interface that allows its client to directly interact with the interface, hiding the interface implementation of Delta and Hilton. Also, an observe patter should be used to update points of the Omega. Last, you are more than welcome to apply any design pattern to your design/implementation.

What you need to submit:

A UML class diagram showing the structure of your program. Your program should stick to the structure of the class diagram. Otherwise, you will lose some points in the final grade.
Use a Word/PPT document to explain how the scenario 1 can be supported by your design to support the open-close principle as well as the application of other design patterns.
Your Java program.
Following the requirements used in the previous PAs and submit your zip file via eLearning.

More products