Develop a java application that allows user to read the data


Assignment

Task

Your task is to develop a Java Application that allows the user to read the data (flight departure city, flight arrival city, year and month, and flight price) from a text file (FlightData.txt), save data in a file (NewData.txt), display data in a text area, sort data by the departure city and search data by the flight price.

The application's GUI components should consist of a menu bar containing 6 menus (Read File, Save File, Display Data, Sort Data, Search Data, Help) and a text area (Display Area for flights) as shown below.

There are six menus (Read File, Save File, Display Data, Sort Data, Search Data, Help). Each of the first 5 menus (Read File, Save File, Display Data, Sort Data, Search Data) contains a single item (Read, Save, Display, Sort, Search) and Help menu contains 2 items (Help, Exit). The menu items are described below.

Read File→Read: Reads the data from FlightData.txt (see format of this file below) and stores the data in a Linked List or an ArrayList. The application must use appropriate exceptions to deal with problems during the file opening (e.g. what to do if file doesn't exist).

The file contains flight departure city (String), flight arrival city (String), flight year-month (String) and flight price (double). A sample file format for FlightData.txt is as follows.

Adelaide, Sydney, 201010, 116
Alice Springs, Darwin, 201103, 428

Save File→Save: Saves all the data from ArrayList/LinkedList to NewData.txt file. The new file only contains departure city, arrival city and price. It also contains the total number of flights. The format for NewData.txt file is as follows.

Adelaide, Sydney, 116

Brisbane, Canberra, 158 Number of total flights: 2

The application must use the appropriate exceptions to deal with problems during the file saving.

Display Data→Display: Displays all the data from ArrayList/LinkedList in the display area as shown below.

Sort Data→Sort: Sorts data by the flight departure city in ascending order using the best sorting algorithm covered in COIT20256 unit and displays sorted data in the display area as shown below. You are not allowed to use any built-in sorting algorithm.

Sort Data→Sort: Sorts data by the flight departure city in ascending order using the best sorting algorithm covered in COIT20256 unit and displays sorted data in the display area as shown below. You are not allowed to use any built-in sorting algorithm.

Help → Help: Provides instructions to user via a dialog box on how to use the application and displays the details (e.g. contact person and email) for further help.

Help → Exit: Allows the user to exit the application.

Data Validation

Input data validation for the flight price entered to search is required. If no flight price is entered or entered flight price is less than $1 and OK button is pressed then the application will pop out a message box with an appropriate message.

Data Structures & Algorithms You must use:

• LinkedList or ArrayList for storing flight object.

• Best searching algorithm (based on your analysis) covered in COIT20256 unit for searching.

• Best sorting algorithm (based on your analysis) covered in COIT20256 unit for sorting.

• Two classes to implement the application. One class, named Flight which describes an individual Flight (fields such as Departure, Arrival, Year-Month, Price and get and set methods) and another class named FlightApplication which contains GUI with components and methods for sorting, searching and file processing.

• Appropriate fields and methods to store/process flight data.

Evaluation and Analysis of Data Structures and Algorithms

• You must justify the reason for selecting the data structure (ArrayList or LinkedList). Why do you think that the data structure used by you is the best data structure for your application? Write maximum 2-3 lines to answer this question in Report.docx.

• You must justify the reason for selecting the sorting algorithm. Why do you think that the sorting algorithm used by you is the best sorting algorithm for your application? Write maximum 2-3 lines to answer this question in Report.docx.

• You must justify the reason for selecting the searching algorithm. Why do you think that the searching algorithm used by you is the best searching algorithm for your application? Write maximum 2-3 lines to answer this question in Report.docx.

• You must run your application 3 times by increasing the data each time (e.g. 7 flights, 700 flights, 7000 flights) and compare time for sorting algorithm. Write in Report.docx, the time taken to sort in each case.

• You must run your application 3 times by increasing the data each time (e.g. 7 flights, 700 flights, 7000 flights) and compare time for searching algorithm (use same search key each time). Write in Report.docx, the time taken to search in each case.

Implementation Platform

You must implement your program in Java using TextPad Editor which is available in University's computing labs.

Format your assignment according to the following formatting requirements:

1. The answer should be typed, double spaced, using Times New Roman font (size 12), with one-inch margins on all sides.

2. The response also include a cover page containing the title of the assignment, the student's name, the course title, and the date. The cover page is not included in the required page length.

3. Also Include a reference page. The Citations and references should follow APA format. The reference page is not included in the required page length.

Attachment:- Assignment-Term.rar

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Develop a java application that allows user to read the data
Reference No:- TGS02121407

Now Priced at $110 (50% Discount)

Recommended (95%)

Rated (4.7/5)