Implement console application that supports BMI analysis

Assignment Help JAVA Programming
Reference no: EM131991742

Assignment -

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.

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

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.

Attachment:- Assignment File.rar

Reference no: EM131991742

Questions Cloud

How this beta compares with the beta you have calculated : Describe how this beta compares with the beta you have calculated. Find the beta reported at a financial website such as Yahoo Finance or Google Finance.
For how long did the espionage continue : What was this person's personal background? What was this person's professional background? Were there any accomplices? If so, explain.
Locate the website for delta dental : Locate the website for Delta Dental. Document your findings, including a summary of the changes, along with a description of a new, revised, and deleted code.
Short term and long term effect on the whole economy : The Federal Reserve Large Scale Assets Purchase has a short term and long term effect on the whole economy. Explain
Implement console application that supports BMI analysis : COIT20245 Assignment. In this assignment, you are to implement a console application that supports simple BMI (Body Mass Index) analysis functionality
Research your local community and state emergency plan : Research your local community and state emergency preparedness plan(s) and then complete an assessment paper.
Illustrate macroeconomic problems and potential monetary : Construct the aggregate demand and aggregate supply model of the macro economy and use it to illustrate macroeconomic problems and potential monetary
Research the various aspects of physical assessment : Research the various aspects of physical assessment. Based on your research and understanding, respond to one of the following.
Relationship between the discount and compound processes : What is the "time value money" ?. Why is it so important?. Explain the relationship between the discount and compound processes.

Reviews

len1991742

5/22/2018 3:12:01 AM

The application must conform to the class diagram of Figure 1, although additional private members and methods are permitted. 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.

len1991742

5/22/2018 3:11:54 AM

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. Note that because BMI is calculated as a floating point value, we can’t (in general) test it for equality. What this means in terms of your test plan is that you do not need to test the category end points – all you need to do is to generate one set of inputs (and the corresponding output) per category. Note that markers will use their own test data when testing your assignment.

Write a Review

JAVA Programming Questions & Answers

  Find and discuss an interesting example of recursion

Find and discuss an interesting example of recursion - thus, an example other than those presented in the readings. Your discussion should: give citations

  Write a java gui application to do temperature conversions

Write a Java GUI application to do temperature conversions between Celcius, Fahranheit, and Kelvin

  Splitting a linked list into two sublists in equal sizes

Write the definition of the method splitMid. Also write a program to test your method. (Use either the class UnorderedLinkedList or the class OrderedLinkedList to test your method)

  Survey conductor application

Survey Conductor Application: You have been asked by your manager to create a user-friendly application that will present a survey to your customers

  Write a program to generate an ascii-graphics

Write a program to generate an ASCII-graphics of an equilateral triangle. The input to your program is a single integer number representing the length of the side of the triangle. This number must be 2 or larger.

  Write program to keep track of employees pays per quarter

Write a program to keep track of their employees' pays per each quarter. There are two types of employees: Managers and SalesReps.

  Perform effectively as a computing and systems development

Perform effectively as a computing and systems development employee. It will almost certainly be a requirement that as an employee, you will need to produce software solutions, generate technical documentations for long term support, and producin..

  Write a java program to simulate a die

Write a Java program to simulate a die. A die has values of either 1, 2, 3, 4, 5 or 6 on the face. You should use the Math.Random() or the java.util.Random() class to generate the values on the die.

  Write the methods used in section two of main

Write the constructor for the SortTraversableLinkedList. It should create the head and tail nodes, and set the size of the list to 0, as in a typical linked list.

  Use the file to extend the code developed using jquery

Use the file to extend the code developed using jQuery. Be sure to include jQuery elements, selectors, and filters as well as event handlers.

  Java upcasting and downcasting

Add a new java Interface "Training". In this Interface, you should have a method call "EmployeeTrain()". Make Employee class implements

  What is object in javascript

Q1 What is Object in JavaScript ? Q2 Write one purpose of using spreadsheets? Q3 Write one purpose of using spreadsheets?

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