Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Assignment 1

Total 50 marks

Worth 20% of total mark

Due date:   21st April 2023 Friday by 5pm

Introduction

In this assignment you create a Java application which help customers of Mt Buller winter resort to create their custom travel deal.  

Here you can find general information about this ski resort   http://www.mtbuller.com.au/Winter/

A deal created in your application must include accommodation.  It also can include lift pass, and lessons.  

When creating a custom package (deal), a customer can choose accommodation by price or type (Hotel, Lodges, and apartments).  Available accommodations can be identified by ID.

A package (deal) is created for one person only.

Customers which could be interested in such packages are different in their experience in skiing. They could be newcomers (beginner level), coming from time to time (intermediate level), and real skiing lovers (expert level).  An expected level must be included in a customer profile for safety reasons.

There are slopes suitable for each level of skiing. Each slope has several lifts of different types and different prices per day. We simplify this by accepting one price for all lift types. Full day lift pass costs $26. There are discounts for a lift pass as following.  If a customer buys a lift pass for 5 days, the total price is reduced by 10%, if customer buys a lift pass for a season, the total price is $200.

Customers can also buy lessons according to their level.  A lesson fee depends on level (for expert level it is $15, for intermediate level it is $20, and for beginners it is $25). A customer can choose how many lessons will be included in a package.

Your system must include the following functions:

1. Display all accommodations    

2. Display available accommodations              

3. Add customer     

4. List customers          

5. Create a package

6. Add a lift pass to package

7. Add lesson fees to package

8. List packages  

9. Save packages to file    

10. Read packages from file

11. Quit

Implementation suggestions

First, design your application using several classes and appropriate associations between classes.

You will have at least such classes as Accommodation, Customer, TravelPackage, and MtBullerResort which is an application manager.

The class MtBullerResort must have array lists of accommodations, customers, and travel packages.

Also, you must have a class MtBullerAdmin with main method to run the whole application.

Customer must have id, personal details, and level of skiing (beginner, intermediate, or expert).

Choose minimal number of variables for all other classes required for maintaining the functionality of the system.

Interaction with a user must be implemented as menu with options listed as system functions. Each menu option will call one or two methods defined in classes. Some methods require search methods to call.

The most important is option 5: Create package. 

It requires creating a method addPackage(). 

This method will need to get input for customerId, a start date and a duration in days. Validate user inputs where possible.

After this method will create package and will add it to array list of packages.

A package must have an accommodation. The method addPckage() can call another method  addAccommodation(TravelPackage pg).  The method addAccommodation() must  search for an accommodation. It can take a user input for an accommodation ID if accommodations list is displayed. It must search a list of available accommodations by ID. If an accommodation is found it must set this accommodation to the package. Note accommodation when added to package will become unavailable.

Options 6 and 7 can add lift pass and lessons to TravelPackage.

Option 8 will display a current state of ArrayList packages.

In option 9 you must save packages into a binary file using ObjectOutputStream. 

In option 10 you must read packages from binary file using ObjectInputStream and store them in ArrayList packages. It must display packages when reading from file.

Important requirements

1.Create an initial list of accommodations (at least 10 accommodations of different types and price).

2.Create an initial list of customers (at least 3 customers).

3.Start your application with populating lists of accommodations and customers.

4. When a user input is required, guide a user what input is expected.

5. Avoid exceptions by including inputs in try-catch block.

It’s required for debugging and marking. 5 marks will be taken for empty initial lists and no guidance what to enter when prompting to enter a value.

Submission

Submit on Canvas all your files in a compressed folder named as <ass1_your_name.zip>

Marking guide

Base classes (Accommodation, Customer, TravelPackage, and MtBullerResort without menu)                    10 (2+2+3+3) marks

Menu implementation:

Options 1, 2, 3, 4                                         10 (2+3+3+2) marks

Options 5, 6, 7                                            20 (10 + 5 + 5) marks

Options 8, 9, 10                                                           10 (2 +4 +4) marks