Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Assignment

1. Introduction

In this assignment, you are to implement a console application that supports simple BMI (Body Mass Index) analysis functionality through a class called BMIAnalyser. A phased implementation approach is recommended; refer to Appendix 2 for further details.

2. The Application

The data to be analysed is to be loaded from 3 arrays containing person identifiers, heights (in metres) and weight (in kgs) using the loadFromTables() method provided in Appendix 1. Loading involves the creation of objects of type Record from each data triple (id[i], height[i], weight[i]). These are to be stored in an array of type Record called data. The size of this array is to be the same size as the data arrays. During loading, the BMI for each individual is calculated, using the following formula:

BMI = weight / (height*height)

where weight is in kilograms and height is in metres. The corresponding category is then determined as follows:

Category

BMI

(kg/m2)

 

from

to

Very severely underweight

 

15

Severely underweight

15

16

Underweight

16

18.5

Normal (healthy weight)

18.5

25

Overweight

25

30

Obese Class I (Moderately obese)

30

35

Obese Class II (Severely obese)

35

40

Obese Class III (Very severely obese)

40

 

This allocation is to be provided as a separate (private) method called classify() that is not provided in Appendix 1. The code for loading is provided in Appendix 1 as the method loadFromTables().

In order to facilitate search, data is to be maintained in ascending order of person id. Sorting is to be done after loading, using a method called sortById(). This method must implement the insertion sort algorithm. Note that loadFromTables() and sortById() are to be invoked from the constructor for the BMIAnalyser class

The application's View class is to execute (using a switch statement) the following command options:

1. Display the record for a specified person
2. Display records for all persons with BMI values within a specified range.
3. Display the minimum, maximum and average BMIs
4. Exit the application

As it is a console application, the user will need to be prompted to enter a command and its arguments (if any). My personal preference is for a minimal interaction scheme, as shown below:

run:
The following commands are recognised
Display this message > 0
Display a specific subject record: > 1 subjectID Display records for all subject records within a range > 2 bmi1 bmi2 Display statistics (minimum, maximum and average marks)> 3
Exit the application > 9
> 1 S01

>

Note that

1. Each command is designated a number
2. Command 1 requires a single argument - the subject id
3. Command 2 requires 2 arguments - the lower and upper bounds of a range of BMI values
4. I have added a "help" command (command 0)
5. The command options are displayed at the start of the application and whenever a "help" command is entered, rather than than after each command.
6. Records are displayed with no explanation of the fields

Feel free to adopt the above scheme or if you prefer, implement a more verbose interaction scheme.

For the commands that require arguments ( i.e. command 1 and command 2), note that

a. For commands 1 and 2, basic error checking is expected. For command 1, an error message is to be displayed if an id does not exist. For command 2, an error message is to be displayed if a member of the range is < 0 or > 100 or if the second member of a range is less than the first member.
b. For command 2, the range is exclusive of the values specified. Consequently, having both members of a range equal is to be flagged as an error.
c. For command 1, binary search is to be used.
d. For command 2, the results are to be stored in an ArrayList for display

The application must conform to the class diagram of Figure 1, although additional private members and methods are permitted.

1579_diagram.jpg

Figure 1. Class Diagram

Note that in Figure 1, the visibility of class methods and attributes are designated as + (public) and - (private). Associations are annotated with a label (for readability) and multiplicity. The multiplicity captures the number of object instances that can be involved in the association. In this case, only two values apply - 1 and *, which means many.

3. Submission
You are to submit a zipped folder containing

- The four .java files that comprise your application. Alternatively, if you have used NetBeans, this can be replaced with a zipped project folder. Details of how to do this are provided in the NetBeans FAQ on the unit website.

- Report.docx. This file contains a test report that includes student name, student ID number, unit name, unit code, a test plan and test results. The test plan is to contain a list of the input values that you have used to test the program, the expected output values and the actual output values generated by your program. The test results are screenshots to show that that the program generates the actual outputs shown in the test plan.

Attachment:- Assignment.rar

Java, Programming

  • Category:- Java
  • Reference No.:- M92868717
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Java

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As