Recent Question/Assignment

COIT20256 Assessment item 1— Assignment 1
Due date: Friday of Week 6 (26th April 2019) 11.45 pm AEST
ASSESSMENT
Weighting: 20%
Length: NA 1
1. Objectives
The purpose of this assessment item is to assess your skills attributable to the following learning outcomes and achieving the expected graduate attributes of advanced level knowledge, cognitive, technical, and creative skills, and self-management.
• Design and implement appropriate data structures for application development
• Analyse, develop and implement software solutions with the focus on data structures and algorithms
• Apply classes, inheritance, polymorphism, and exception handling
2. Assessment task
Your task in this assessment is to analyse the given problem, model, and design the required data structures using UML class diagrams. You will be implementing the software solution, applying efficient algorithms, inheritance, polymorphism, and exception handling. The topics required for this assessment task are from Weeks 1-5. Your Java Application should have an interactive Graphical User Interface (GUI) based on the JFrame class using SWING GUI components. You should also write a report, as specified in this document, demonstrating your conceptual knowledge.
2.1 Problem
Hotels are the heart of tourism industry in any nation. Hotels are booked using a software application with an easy to use, and intuitive user interface. NEXT hotel is a major hotel business group and they have a hotel in Brisbane. The IT manager of the Brisbane operation has kindly agreed to support a project to develop a prototype for a new Hotel Booking System (HBS) which will be further developed into a webservice. The support for the full development of the system depends on the quality of the prototype.
Therefore, you are invited to design and develop an initial prototype for the HBS to enable a user to enter the customer details and booking details and save the data to a file. You will be developing the Java application with a GUI.
The users accessing the HBS should able to:
1. Enter the Customer details
2. Enter room booking details 3. Save the entered data to a file.
The hotel room details including rates, and payment processing is outside the scope of this work.
COIT20256 Data Structures and Algorithms Term 1 2019
2.2 Design Guidelines
You can use the following guidelines in your modelling and GUI design.
Data Structures
You may follow the class design given below. You should read the specification carefully and design the classes using UML class diagrams and include the attributes with correct data types and all the methods, clearly indicating public or private. Clarify your doubts during the design stage so that your implementation can be less error prone and faster to complete.
i) Customer class
This is a generic class and has the attributes: title
first name last name email address phone
This class should have:
a parameterised constructor, accessor, mutator methods, and a toString() method. ii) DomesticCustomer class
This class extends the Customer class.
In addition to the inherited attributes, this class has:
Driver License Number
Expiry Date
This class should have a parameterised constructor, copy constructor, a default constructor, accessor, mutator methods, and a toString() method.
iii) InternationalCustomer class This class extends the Customer class.
In addition to the inherited attributes, this class has:
Passport Number
Country
Expiry Date
This class should have a parameterised constructor, copy constructor, a default constructor, accessor, mutator methods, and a toString() method.
Hints and tips: Refer to Week 3 Lecture and tutorial solutions, and the Textbook chapter on Polymorphism for the correct implementation of polymorphic behaviour.
iv) Booking class
This class has the attributes:
Check in
Check out
Number of guests
Room type
Room rate
This class also includes a Customer object for one of the guests who does the booking. The check in and check out are dates in which the guests will be checking in checking out of the rooms. Use Date type variable for storing the check in and check out dates.
The room type is a value which specifies the type of room and amenities in that room. You can use the list of room types and rates obtained from hotel management and these are:
Superior_Queen: $250, Breakfast_Queen: $270, Deluxe_King: $240, Deluxe_Twin: $240.
v) DataFile class
This class will have a parameterised constructor that takes the filename to be created.
Include a method to write data a file named ‘bookingData.csv’ using the values from and ArrayList of Bookings.
Use necessary file handing exceptions. vi) BookingGUI class
This class should have all the GUI components as described under the Graphical User Interface Design section. This class:
1. has the main method and starts the application
2. initialize the GUI components
3. stores the user entered values in temporary variables, and creates necessary objects
4. stores the data file name and creates the DataFile object
5. invokes the DataFile class method to write the objects to the DataFile
Graphical User Interface
The application should have a GUI for user interactions. This GUI should have the necessary components to enable the user to execute all the functions as provided in Section 2.1 above. You may use the guidelines provided below for your GUI design and implementation. Variations to the provided guidelines are acceptable as long as it meets the user requirements.
i) Input Panel
The top panel can have Labels to display attribute names and TextFields to enable the user to enter the attribute values for the Customer and Booking classes. Use RadioButtons for user to select between Domestic Customer and International Customer. Once the user chooses one of the options, the required Labels and TextFields should be displayed for entering data. Use a ComboBox to display and choose the Room types. You may arrange Labels and TextFields in horizontal or vertical alignments. You can use ii) Display Panel
This panel can have a TextArea to display welcome message to the User and other messages during the program execution. Once the user clicks the ‘Save Data’ Button, display the saved Booking details. iii) Button Panel
This Panel can have a label “Command Buttons” and can contain the required Command Buttons of ‘Enter Data’, ‘Save Data’, ‘Clear Display’ and ‘Quit’.
A full GUI design diagram is not given to encourage you to design user friendly interface.
The functions of the three Command Buttons are given below.
Display a welcome message when the program starts.
Enter Data Button
The user enters the Domestic or International Customer details and the Booking details and clicks the ‘Save Button’.
You should validate the check in and check out entries so that:
a) the check-out date should be later than the check in date.
b) both the dates should be later than the current date. (assuming bookings are done and confirmed at least 12 hours prior to check in.)
If there are errors, appropriate error message should be displayed.
All the TextFields should be completed. Display appropriate error messages if the user hasn’t entered value in any of the TextFields.
If entries are correct display a message informing booking confirmation. The Booing and Customer details should be added to an ArrayList of Booking.
An example display is shown below. You can design and choose your own wordings for the message to make it user friendly.
Hello Michael Thank you for using the NEXT HBS Your booking as shown below is confirmed.
Mr Michael Martin, martins@bigpond.com, 0453234234, T12345, 07/2020,
Check in 05-03-2019, Check out 08-03-2019 Guests 2, SUPERIOR_QUEEN, $250 per night
You should also display appropriate error messages to help the user to complete the entry.
Save Data Button
User clicks this Button to write the Array List of Bookings to the Data file. The data should be written, separating values by commas. See example below.
Dr, Lily, LI, li@cqu.edu.au, 03452678, N2345, Australia, 06/2030, 08-03-2019, 2, DELUXE_KING
Clear Display Button
Clicking on the “Clear Display” button should clear all contents from the TextArea, the TextFields, and the data structures storing the previous entries. The ComboBox will still have the list of Room types. Quit
The “Quit” button should allow the user to exit from the application.
3. Coding
Include necessary accessor, mutator methods, constructors, and toString() method for each class. Also, follow good coding practices, using meaningful names, camel case notation for naming, constants as necessary, and include meaningful comments. You can use NetBeans to develop your application. Follow the coding standards given in the Unit website.
4. Report
You should submit a report containing the following details.
1. UML class diagrams for the classes
2. Test plan showing input data, expected results, and actual results
5. Assignment Submission
You should submit the following source code files and word document using the Moodle online submission system. (Note: the file names/class names could be changed to meaningful names). Please do not zip the whole project folder and submit it.
• Customer.java – Source code for the Customer class
• DomesticCustomer.java– Source code for the DomesticCustomer class
• InternationalCustomer.java – Source code for the InternationalCustomer class
• Booking.java
• BookingGUI.java – Source code for the BookingGUI class
• DataFile.java – Source code for DataFile class
• Report.doc – Your word document containing the report.
Assessment Item 1 Marking criteria
S.No Total Marks - 20 Marks
Allocated Marks Scored
1 Graphical User Interface Presentation 2
2 Design and use of appropriate data structures 2
Implementing classes and using objects, methods, aggregation, and polymorphism 3
Efficient program design: lack of redundant or repetitive code, correctly designed loops, blocks, and methods 2
Use of exception handling 1
6 “Enter Data” button function 2
“Save Data” button function 2
“Clear Display” and “Quit” buttons functions 1
12 Good coding practices including comments, indentation, use of constants as required, use of meaningful names, and camelCase notation for names 2
13 Well presented report with student details, UML class diagram, and demonstration of testing all functions of the program 3
Penalties
Late Penalty (-1.5 marks (5% of total allocated marks) per calendar day)
Source code found entirely different from the styles followed in the Unit or containing constructs outside of this Unit will be penalised (-1 to -10 marks depending on the amount of source code)
Plagiarism (penalty as per the plagiarism policy)
Total 20