Assignment 2 Specification
Your task is to develop a Java windowed application for a nursing home management system. The program allows the user to read the resident name, age, and health condition description from a text file (ResidentData), save data to the same file, display data in a text area, sort data by the resident name, search data by the resident name, add a record and delete an entry.
The application’s GUI components should consist of a menu bar containing four menus (File, Tools, Help and Exit) and a text area as shown below.
How the program works
There are four menus (File, Tools, Help and Exit). The File menu contains 2 items (Read and Save), the Tools menu has 5 items (List, Add, Delete, Sort and Search), the Help menu has 1 item (Details) and the Exit menu has 1 item (Exit). The menu items are described below.
File→Read: Reads the data from the file ResidentData.txt (see format of this file below) and stores the data in a Linked List or an ArrayList. The application must use appropriate exception handling to deal with problems during the file opening (e.g. what to do if file doesn’t exist).
The file contains a series of records, each record with the resident name (String), age (integer) and health condition description (String). A sample file format for ResidentData.txt is as follows.
Harry Potter,90,Good health
David Packer,78,Poor health
James Lin,68,Chronic illness
Michael Li,79,Poor Health
John Smith,66,Good Health
Max William,89,Diabetes II
File→Save: Saves all the data from ArrayList/LinkedList to the same file name ResidentData file. The saved file contains the resident name, age and health condition description, separating with comma. This file should be allowed to re-open and read data as the File->Read operation as above. The application must use the appropriate exception handling to deal with problems during the file saving.
Tools→List: Lists all resident records from ArrayList/LinkedList in the display area as shown below
Tools→Add: Adds a resident entry to the Linked List via a series of input dialog box to enter the resident name, age and health condition description respectively. For example, the following input dialog box allows entering the resident name.
Tools→Delete: Deletes a resident entry by entering the resident name as the following input dialog box. Accordingly, the matched object of a resident stored in the Linked List is removed.
Tools→Sort: Sorts data by the resident name 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. You must write your own code to implement sorting
Tools→Search : Asks the user to enter a resident name via an input dialog box as shown below and uses the best searching algorithm covered in COIT20256 unit to search for the
given resident name. It displays appropriate message found or not found in the display area.
You must write your code to implement searching.
Help→Details: Provides the user with some brief information on this application program as shown in the following message bo
Exit→Exit: Allows the user to exit the application.
Input data validation for the resident name entered to search is required. If no resident name is entered and OK button is pressed, then the application will pop out a message box with an appropriate message.
It can assume that the program is not concerned the issue of uniqueness of resident name. A record is a resident object. Two records having the same resident name is allowed for simplicity. To test sort and search algorithm efficiency with 1000 records in the data file, you can copy and paste repeating records in the data file. In addition, you can assume that the resident name is case sensitive.
Data Structures & Algorithms
You must use:
individual Resident (fields such as resident name, age, and health condition description, and get and set methods) and another class named ResidentApplication which contains GUI with components and methods for sorting, searching and file processing etc. • Appropriate fields and methods to store/process resident data.
Evaluation and Analysis of Data Structures and Algorithms
You may use any platform, however your assignment submission must compile in Java using TextPad Editor which is available in University’s computing labs and may also be downloaded from the following site:
You MUST show your tutor the progress (Resdient.java and ResidentApplication.java files) in Week 9 Tutorial and Week 10 Tutorial. If you are a distance student, you need to contact the unit coordinator by e-mail.
You MUST submit on 1 February 2108 the following files using the Moodle online submission system.
Warning: You must submit your own assignment and correct files
|Total Marks – 30||Marks Allocated|
|1||GUI implementation and presentation (menus, display area, etc.)||4|
|3||Display data from file||2|
|4||Add a resident object||1|
|5||Delete a resident object||1|
|6||Save data to file||2|
|9||Help and Exit||1|
|10||Input validation and pop out message box||1|
|11||Design – fields, classes, objects, methods||2|
|12||Quality of code (comments, indentation, naming and readability)||2|
|Quality (content, presentation, language) (1 mark)|
|Reason for selecting data structure ArrayList or LinkedList (1 mark)|
|Reason for selecting the best sorting and searching algorithms (2 mark)|
|Time comparison/analysis of sorting and searching algorithms (2 marks)|
|14||Late submission penalty is 5% of total mark per day||-1.5/day|
|15||Penalty for using things not covered in lectures and tutorials||Up to -10|