Write a Java Application that uses an interactive GUI

Assignment Help JAVA Programming
Reference no: EM132358269

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.

  • 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.

Assessment Task - 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. Your task is to develop a Java Application that lets the user enter height and choose gender, age group, and the most suitable PAL so that the application displays the energy requirements in Mega Joules. The application should contain a GUI as outlined below. The GUI components should consist of the following panels.

i. A top panel that contains four (4) Text Fields, one Password Field, two ComboBoxes (drop down list), seven Labels, and two Radio Buttons and a Login command button.

ii. A middle panel that contains a Text area to display the user's estimated energy requirement details.

iii. A bottom panel that contains four buttons which are Load Data button, Display Energy button, Clear Display button and Quit button.

The functions of the four buttons are described below.

A. Load Data

Initially the Load Data button remains disabled; in order to enable it, the user needs to click on the Login button after entering the name and the password to the designated fields on the GUI. You may use a suitable name such as Smith or something and a password. You should clearly mention your password in your report and java file comment so that your program can be tested for marking. Screenshots are not provided so that you can interpret the requirements and specification, sketch the design, and implement the design precisely. The Load Data button can be used to read the data file which contains height, weight, BMR, and energy requirements for various PALs for males and females in the age groups of 19-30 and 31-50. The data file is COIT20256Ass1Data.csv provided for you in the moodle. After loading the data file upon the user's click on the Load Data button, the ComboBox on the GUI needs to be filled with the description of PAL as given in the table below. Also, the Age group ComboBox on the GUI needs to be filled with the list of age groups read from the file. One row in the file contains data for one age group, but for both genders. Reading the assignment specification and contemplating over the data file content will give you insight to sketch the design for proper implementation.

Table 1 - PAL Description and Value

Description

Value

bed rest

1.2

very sedentary

1.4

light

1.6

moderate

1.8

heavy

2

vigorous

2.2

B. Display Energy

Before clicking on the Display Energy button, the user has to enter his/her height, for example, 1.7 meter in the Text Field; choose the gender, for example, male by clicking the Radio button; and select the age group, for example, 31-50. This should display the 'Expected Average Weight' of 63.6 kg in the Text Field for that height as provided in the data file. When the user clicks the Display Energy button after selecting a suitable PAL description, for example, Vigorous from the drop down list, the corresponding PAL number such as 2.2 should be displayed on the Text Field; and energy requirements of 14.8 Mega joules along with age group of 31-50, PAL description of Vigorous, PAL number of 2.2, and expected average weight of 63.6 kg should be well-worded, well-indented, and displayed in the Text Area. For the clarity, the above description uses a running example; however your program should appropriately output for any input.

C. Clear Display

Clicking on the Clear Display button should clear all contents from the display area and set the TextFields and ComboBoxes to their default values.

D. Quit

The Quit button should allow the user to exit from the application.

Data Structures - You can use the classes given below as a guideline for your design.

i. enum PAL -Physical Activity Level

The descriptions and corresponding values of PALs are modelled as an enum. This is provided for your use in the moodle as PAL.java.

ii. PALdata class

This is to store the PAL and corresponding energy requirement. This class is already provided for your use in the moodle as PALdata.java

iii. BMRdata class

The purpose of this class is to store the values of age group, gender, height, weight, and bmr read from each row of the file.

a. Include appropriate fields to store:

height, weight, bmr which are real numbers to be stored in double data type, age group and gender which are strings.

b. A constructor and necessary accessor and mutator methods to get and set values

c. A toString() method that displays the BMRdata attributes.

iv. EnergyData class

a. This class should have the fields to store:

BMRdata, and set of energy needs for various PALs corresponding to the BMRdata. This could be stored as an ArrayList of PALdata.

b. It should also include constructor, mutator, and accessor methods

c. A toString()method for displaying the stored data.

v. User class-an abstract class

This class should have

a. Fields to store user-entered values such as name, gender, age group, and height.

b. Constructor, accessor and mutator methods

c. A toString() method for displaying the User details.

vi. UserEnergyNeeds class

This class extends the User class. This class should have member fields to store expected average weight, bmr corresponding to the user's age group, gender and height, and the PALdata to store chosen PAL and corresponding energy requirement. The height entered should be between 1.5 and 2m inclusive. Use validation and exception handling to handle this error.

vii. GUI Components class

This class should have the GUI components listed above.

a. It should have the methods to set up the GUI components and the event handling methods.

b. This class should have method to read data from the file and load data structures appropriately.

c. This also contains main method.

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 File.rar

Verified Expert

The task of the assignment is to design a java GUI program.The task of the program is to load the CSV file and based on PAL description the energy is displayed to the user. The application also contains the clear button to clear the controls and quit button to close the application. The assignment also contains the report the shows the class diagram of the application.

Reference no: EM132358269

Questions Cloud

Implement and monitor the plan for managing project finances : BSBPMG522 Undertake Project Work Assignment, Mercury Institute of Victoria, Australia. Implement and monitor the plan for managing project finances
Analysis and produce a board briefing paper for tabling : Topic 1: Walmart and Foreign Corruption. Analysis and produce a board briefing paper for tabling at the next meeting of the company's board of directors
Find out optimal number of clusters : Read the data file and check for any missing values. Plot elbow chart or scree plot to find out optimal number of clusters
Performing the formal discovery upon request : Execute expert testimony in defense of your computer forensics or incident response report. Performing the formal discovery upon request
Write a Java Application that uses an interactive GUI : COIT20256 - Data Structures and Algorithms Assignment, Central Queensland University, Australia. Write a Java Application that uses an interactive GUI
Definition of Decision tree : Definition of Decision tree? Feature of decision theory problem? Decision making under both certainty and uncertainty? Steps involve in solving decision problem
Discussion on a relations-oriented or a task-oriented leader : Please find journal articles to add into the document for both questions - Would you consider Woodside a relations-oriented or a task-oriented leader
What would you do to achieve high employee satisfaction : If you were the Research Director at Sunshine, what would you do to achieve both high employee satisfaction and high performance? Discuss in detail
What will your advice be to the Director of Social Media : MNG81001 - Management Communication Assignment - Persuasive Argument, Southern Cross University, Australia. Topic - use of social media in the workplace.

Reviews

len2358269

8/16/2019 4:23:01 AM

Assignment Submission - You should submit one zip file containing the following files using the Moodle online submission system. (Note: the file names/class names could be changed to meaningful names) BMRdata.java -Source code for the BMRdataclass, EnergyData.java -Source code for the EnergyDataclass, User.java -Source code for the Userclass, UserEnergyNeed.java, UserEnergyInterfaceGUI.java -Source code for the GUI components and main method.

len2358269

8/16/2019 4:22:52 AM

A report (Report.docx ) containing the following details: UML class diagrams for the classes BMRdata, EnergyData, User, and UserEnergyNeed. Show the association, aggregation, and composition in your implementation. Test plans showing input data, expected results, and actual results; Provide clear screen shots to demonstrate the evidence of your testing. Please do not zip the whole project folder, and submit it.

len2358269

8/16/2019 4:22:45 AM

Assessment Marking Criteria - Graphical User Interface Presentation(Use appropriately sized components and alignments) (0 mark if program doesn't run or any malfunction) 1.5 marks. Design and use of appropriate data structures 2 marks. Designing classes and using objects, methods, and inheritance 4 marks. Use of exception handling(use appropriate exception classes and informative messages) 1 marks. Login button and Load Data button function 2 marks. Display energy button functions 2 marks. Clear Display button and Quit button function 1 marks.

len2358269

8/16/2019 4:22:37 AM

Indentify and Justify two prominent limitations and implement one 1 marks. Good coding practices for readability and quality of code (comments, indentation, use of constants and meaningful names, and camelCase notation for names): 0.5 for each part - 2 marks. Report [presentation (0.5 mark); UML class (1 mark); showing association, aggregation, and composition (0.5 mark); demonstration of testing all functions of the program (1.5 marks)] 3.5 marks. Penalties - Penalty for the late submission (-1 per day or part of a 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).

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd