Implement a console application

Assignment Help JAVA Programming
Reference no: EM131971018

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
<S01,1.8,80.0,24.7, Normal (healthy weight)>
>

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.

1796_class 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:- Appendix.rar

Reference no: EM131971018

Questions Cloud

Major types of cellular adaptation : The four major types of cellular adaptation are hypertrophy, hyperplasia, metaplasia and dysplasia. Briefly describe each of these types of cellular adaptation
Identify literature review that are directly connect to sids : Identify and discuss in literature review 10 peer-reviewed sources published within the last 10 years that are directly connected to SIDS.
Which proposal should be accepted for production horizon : It is estimated that the annual sales of an energy saving device will be 20,000 the fust year and increase by 10.000 per year until 50,000 units are sold.
What is the market value of the firm before and after : As a result, the firm's debt-equity ratio is expected to rise from 40 percent to 50 percent. The firm currently has $4.1 million worth of debt outstanding.
Implement a console application : COIT20245 Assignment - implement a console application that supports simple BMI (Body Mass Index) analysis functionality through a class called BMIAnalyser
Compare and contrast two change theories : Compare and contrast two change theories, and determine which theory makes the most sense for implementing your specific EBP project. Why?
Calculate the re for your stock using the capm formula : Calculate the Re for your stock using the CAPM formula if the market risk premium (MRP) is 6.8% and the risk free rate = 2.1%
Why companies need long term financing : What are some examples of why companies need long term financing (how might they use the funds)? What are the possible issues that can arise.
Determine the average risk premium you earned : The long term inflation rate average was 3.2% and you invested in long term corporate bonds over the same period which earned 6.1%.

Reviews

len1971018

5/5/2018 12:59:53 AM

hi I wanted to know the quote for this assignment. actually the deadline is 24 may but I want it early because I want to get it checked by my tutor before submitting and if any changes needed then I can go through it. also wants to mention that the last assignment you made for me was good but one task was missing because of which I lost 2 marks. please make sure that u go through marking criteria and fulfil everything. before confirming about my this asgnmnt I want to know the quote. thanks

len1971018

5/5/2018 12:58:45 AM

5 Coding Style (5 marks) Program logic /1 Spacing and indentation conventions /1 Naming conventions /1 Comments /2 6 Report (5 marks) Test plan /3 Test results /2 Sub-Total /30 Penalties Does not compile/run: 25-30 marks Late submission : 5% (1.5 marks) / day or part of a day Total /30

len1971018

5/5/2018 12:58:33 AM

4. Marking Criteria Criteria Marks Allocated 1 Functionality: Assignment2 class (2 marks) Construction of objects as per spec /2 2 Functionality: View class (3 marks) Command loop implementation /2 Constructor implementation /1 3 Functionality: Record class (2 marks) Constructor, getters implementation /2 4 Functionality: BMIAnalyser class (13 marks) Find record by id (0 if binary search not used) /3 Find records by range of BMI /3 Find lowest BMI /1 Find highest BMI /1 Find average BMI /1 Sort records (0 if insertion sort not used) /3 Calculate category /1

len1971018

5/5/2018 12:58:04 AM

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.

Write a Review

JAVA Programming Questions & Answers

  Develop the implementation file student.cpp

Required to implement the class to develop the implementation file Student.cpp that conforms to the following specifications

  Create a class with so-called boundarycells

You are to create a class with so-called BoundaryCells. Methods in the class throw exceptions under certain conditions - The constructor has two logical

  In this project you will simulate some people catching fish

in this project you will simulate some people catching fish in a lake. the purpose of the assignment is to get used to

  Create the visit method and whatever other methods you see

You have been provided with a framework for a java application. It will not compile because there is a class and method missing (Visitor::visit). Your assignment is to create the visit method and whatever other methods you see fit. There are some ..

  Explains the overview and the structure of your program

Final result should be organized as a document which explains the overview and the structure of your program, real code, execution results (including captured image), and the conclusion including justification of your program.

  The methods getsaleprice and getsaleweight

The program must include five methods: printSale, getSalePrice, getSaleWeight, calcTax, and calcShipping. The method printSale takes no input parameters and has a return type of void; it prints values by by calling the other four methods and computin..

  Design a single class that expresses the commonality

Design a single class that expresses the commonality of these concepts.

  Create a new class called idealweight

CSC 1760 Introduction to Programming. In the new package, create a new class called IdealWeight. Make sure your new class is fully defined and has a main method. This class will calculate the ideal weight (and the acceptable ranges) of both males..

  Concepts of polymorphism

This lab introduces students to the concepts of polymorphism, early binding, late binding, abstract classes, and virtual class functions. This will be done in the context of performing calculations on basic geometrical shapes

  Create a private field to represent each of these states

Create three public classes: one named App, one named Pet and one named PetOwner. The App class has a static void main method that performs all the actions for the Deliverable A and Deliverable B requirements.

  Determine the exact number of statements

CMPT 280- Intermediate Data Structures and Algoirthms - Determine the exact number of statements Express the function you obtained in part a) in big-Θ notation.

  Picky publishing house publishes stories

Picky Publishing House publishes stories in three categories and has strict require- ments for page counts in each category. Create an abstract class named Story that includes a story title, an author name, a number of pages, and a String message. In..

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