Write a java application that uses an interactive gui

Assignment Help Computer Engineering
Reference no: EM132362124

Assignment

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

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

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.

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

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

Reference no: EM132362124

Questions Cloud

Identify financial and ICT issues for key business functions : MOD003353 Business Environment Assignment, Anglia Ruskin University, UK. Identify financial and ICT issues for key business functions
Earth with light and the warmth of hospitality : A superior example of a company vision that is short, specific, memorable, clearly articulated, and forward-looking is
How denaturing protein alters the function of protein : Describe how denaturing a protein alters the function of that protein. Explain how water in your body helps to regulate body temperature
Explore the architecture of a 5g network : Compare standards-based technologies used in various networks - Identify and analyse the issue related to 5G network coverage? What is a solution to address
Write a java application that uses an interactive gui : COIT20256 Data Structures and Algorithms-Central Queensland University-Australia-Write a Java Application that uses an interactive Graphical User Interface.
What are the pros and cons for federal and private sector : What are the pros and cons for the federal and private sectors to collaborate to combat cyber crimes and criminals?
Provide a general concluding statement : Provide a general concluding statement of why this is significant/why the audience should care/how this debate has contemporary relevance
Regulate pornography and to develop definitions : The attempt to regulate pornography and to develop definitions that do not run afoul of the First Amendment is expanding as the Internet becomes
Explain how to access rsat : Windows domain controllers are often in remote locations so system administrators often use RSAT to access and manage domains.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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