Write a java console application that calculates bmi

Assignment Help JAVA Programming
Reference no: EM131948828

Assessment Task

You are to write a Java console application that calculates and classifies BMI (Body Mass Index) for individuals. The number of individuals (N) is fixed at 10, so it should be declared as final int N = 10 in your program.

BMI is calculated using the following equation: BMI = weight / (height*height) where weight is in kilograms and height is in metres.

defines the following 8 categories for BMI:

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

 

For each person, you are to enter their weight (in kilograms) and height (in metres).The application is to then calculate and display the BMI, together with the corresponding 8 level category. When all data has been entered, a summary report consisting of
1. The lowest BMI
2. The highest BMI
3. The average BMI
4. The number of individuals with normal BMI
5. The number of individuals with higher than normal BMI
6. The number of individuals with lower than normal BMI is displayed.

Normal, low and high BMI values are defined according to the table below:

Category

BMI (kg/m2)

 

from

to

Low

 

18.5

Normal (healthy weight)

18.5

25

High

25

 

Below is example output for N = 3
Your welcome message goes here ...

Height for person 1 (m): 1.82
Weight for person 1 (kgs): 80
BMI for person 1: 24.2 which is normal (healthy weight) Height for person 2 (m): 1.82
Weight for person 2 (kgs): 100
BMI for person 2: 30.2 which is moderately obese Height for person 3 (m): 1.82
Weight for person 3 (kgs): 60
BMI for person 3: 18.1 which is underweight

Summary
*******
Lowest BMI : 18.1 Highest BMI : 30.2 Average BMI : 24.2 Number with low BMI: 1
Number with normal BMI: 1 Number with high BMI: 1

Your exit message goes here ...

Your application is to follow the same format for input and output as in the example above, but with customised welcome and exit messages.
The application is to use the following classes and methods: public class BMICalculator {
public BMICalculator() {
// no code required
}

public double value( double weight, double height ) {
// return BMI;
}

public String classification8( double bmi ) {
// return the 8 category (Wikipedia) classification for this BMI
}

public String classification3( double bmi ) {
// return the 3 category (high, normal, low) classification for this BMI
}
}

public class Assignment1 {

// no attributes required

public static void main(String[] args) {
// local variable declarations go here
// display welcome message
// loop to input an individual's height and weight and calculate and display BMI, calculate summary values
// generate and display summary
// display exit message
}
}

Submission

You are to submit a zipped folder containing

The two .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 available 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.

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. In generating these inputs, you may find a BMI calculator useful. Note that markers will use their own test data when testing your assignment.

Reference no: EM131948828

Questions Cloud

Describe how electricity is used in your house : Describe how electricity is used in your house and how the energy usage may be reduced. Describe how you collected your information.(Don't write about this).
Advantages of deploying closed-circuit television : Evaluate advantages of deploying closed-circuit television (CCTV) in a waiting room.
Positive numbers-corresponding squares : Write program which prints the following columns: the first 100 whole positive numbers, their corresponding squares
Sequential search function is searching for a value : If a sequential search function is searching for a value that is sorted in the last element of a 10000 element array
Write a java console application that calculates bmi : COIT20245 - Write a Java console application that calculates and classifies BMI (Body Mass Index) for individuals
Which complaints should go to internal affairs : Based on your reading and the accreditation standards, discuss what you believe comprises a thorough process for receiving and documenting complaints including.
Prove you paid bill or made charitable contribution : If you need an original check to prove you paid a bill or made a charitable contribution.
Identify the multiple level of government and health service : Identify the multiple levels of government and the health services that would be expected to react to a disaster. Describe the assets of this community.
Networking intern at richman investments : You are a networking intern at Richman Investments. An employee of the company used employer-owned equipment to access the Internet and check

Reviews

len1948828

4/19/2018 1:45:24 AM

7 Overall logic and program Calculating quantities /4 Spacing and indentation conventions /1 Naming conventions /1 Comments /2 8 Report Test Plan /2 Test results /3 Sub-Total /20 Penalties Does not compile: 15 marks Late submission : 5% (1 mark) / day or part of a day Total /20

len1948828

4/19/2018 1:45:16 AM

Marking Criteria Criteria Marks Allocated 1 Variables, constants and types Declaring and using variables and constants /1 2 Objects and classes Creating/declaring and using objects and classes /1 3 Loops Using loops and conditions /1 4 If statements Using if statements and conditions /1 5 Methods Declaring and using methods /1 6 Inputs and Outputs Reading input /1 Displaying results /1

len1948828

4/19/2018 1:45:09 AM

You are to submit a zipped folder containing The two .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 available 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

  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