Reference no: EM132370115
Data Structures and Algorithms Assignment -
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.
- Analyse, develop, and implement software solutions.
- Choose and compare appropriate data structures and algorithms in program design.
- Apply classes, inheritance, polymorphism, and exception handling.
- Test software implementations to ensure correctness and maintainability.
Assessment Task - There are two design and implementation parts, Part A and Part B, in this assignment. Read the assignment description, think about the points in the description, and connect the points to understand the clear picture of the overall task that you are required to do. The better and earlier you understand the overall task, the better and earlier you can design, implement, test, and document your task. Start early!
Part A -
In this assignment, you are required to write a Java Application that uses an interactive Graphical User Interface (GUI) based on the JFrame class using SWING GUI components. You will also be designing and implementing the software solution using appropriate data structures and application of classes, inheritance, and exception handling. The case study for developing a solution is given below.
The food consumption of a person is to meet the daily energy requirements. The energy requirement is estimated using a person's age group, gender, height, weight, basal metabolic rate (BMR), and physical activity level (PAL). There are data available on estimated energy requirements for various PALs and BMR. So, by choosing the correct age group, gender, height and PAL, the energy requirements can be found from the data set. Use the given data file named COIT20256Ass1Data.csv available on the moodle, as it contains the set of data.
In Assignment One, you have developed a Java Application that lets a user enter height and choose gender, age group, and the most suitable PAL; and the application displays the energy requirements in Mega Joules.
In this assignment (Assignment Two), you are required to extend your first assignment so that the user can save the user's details to mysql database table(s). You are required to programmatically create database and appropriate table(s) to store the user's details; and the user's details include the data such as the user's name, height, age group, gender, PAL description, PAL level or value, energy requirement, and expected weight. Your application should display all users' data from the database table(s).
In addition to the GUI components you have in Assignment One, include the following two components to the Assignment Two as outlined below:
a. Save Button in the bottom panel is to save the user's data to the database table(s). The user's data as mentioned above include the user's name, height, age group, gender, PAL description, PAL level or value, energy requirement, and expected weight b. Display All Button in the bottom panel is to display all users' data from the database table(s). This Button enables the user to view all the database records that display all users' data on the display area in a given order. The given order of display includes Name, Age Group, Gender, PAL Description, PAL Value, Height, Energy Needs, Expected Weight. The database records will have a unique id. It is not essential to display the id.
Part B -
Your task in this part of the Assignment is to demonstrate the appropriate use of various data structures such as stack, priority queue, set, and map for the given data.
While using these data structures for the given data, explain the benefits that you can achieve by using the appropriate data structures. You need to complete the following steps in your use of various data structures.
i. Read the names from the file and load in a priority queue. Display the values from the priority queue using the peek() method. Describe your observation of change to the list of names in the report file.
ii. Move the list of names from the priority queue to stack. Move the list of names from stack while displaying the value to a set. Describe your observation of the stack list of names.
iii. Display the names from the set and again describe your observation the list of names.
iv. Create a map and store the names with associated student Id and display the values.
Data Structures - In addition to the classes that you have in Assignment One, you are required to create and use the DatabaseUtility class and DataStructures class as outlined below for your design.
DatabaseUtility class needs to implement all the tasks related to
i. creating the database and the table, userEnergy programmatically; Give meaningful names to database and table(s).
ii. inserting the data into the database table(s) programmatically
iii. retrieving or extracting records from the database table(s) programmatically.
Include a linkedList of UserEnergyNeeds class to store the extracted data from the database. Use PreparedStatements to get the user input from GUI interface and use them for populating database table(s). Also use PreparedStatement to execute query to extract data and store the records in the linked list.
Coding - You can build your application using NetBeans. It is highly recommended that you create the GUI components using code rather than 'designer' and 'click and drag' of the NetBeans. This ('designer' and 'click and drag' of the NetBeans) creates code which is not maintainable. Remember, this is a good prototyping tool, but not recommended for coding. Commence with one class at a time, test it and then incrementally add the next. Follow good coding practices by using meaningful names, camel case notation for naming, constants to avoid numbers inside the body of the methods, as necessary. You should follow the Java Coding Standards that you can find under the section of Unit Resources. Include meaningful comments.
Attachment:- Data Structures and Algorithms Assignment Files.rar