Bmi - Python Project
Bmi - Python Project
ASSIGNMENT ON
Submitted by
BHARGAV B J
1BI22IS019
CHIRAYU SHARMA GK
1BI22IS021
PRIYA N V
Assistant Professor
Dept of ISE, BIT
TABLE OF CONTENTS
3 SOURCE CODE 5
4 OUTPUT 7
CHAPTER 1
INTRODUCTION TO BMI
A Body Mass Index (BMI) calculator is a mathematical tool used to assess an individual's
body composition and determine whether their weight falls within a healthy range for
their height. It is a simple and widely used method for estimating a person's overall body
fat based on a mathematical formula involving their weight and height. The BMI formula
is as follows:
BMI = weight(kg)/height(m)^2
Where:
The BMI calculator provides a numeric value, which can then be interpreted using standardized
categories to assess whether a person is underweight, normal weight, overweight, or obese. These
categories typically fall within the following ranges:
While the BMI calculator is a useful tool for quickly assessing body weight relative to height, it does
have certain limitations. It does not take into account factors such as muscle mass, bone density,
age, gender, or distribution of weight, all of which can affect an individual's health and risk
factors.
Therefore, it is crucial to consider BMI results in conjunction with other health assessments
and consult with a healthcare professional for a more comprehensive evaluation.
In the field of Boolean algebra, BMI calculators do not directly relate to its principles.
Boolean algebra deals with binary logic and is primarily used in computer science and
mathematics for logical operations and circuit design. The BMI calculator is more related to
basic arithmetic and statistics, focusing on assessing physical health rather than logical
operations.
Functions:
1.Import Statement:
import java.util.Scanner;
This line imports the Scanner class from the java.util package. The Scanner class is used to obtain
user input from the console.
2.Class Declaration:
public class BMICalculator {
This line declares a class named BMICalculator. In Java, a class is a blueprint for objects.
3.Main Method:
public static void main(String[] args) {
This line declares the main method. In Java, the execution of a program starts from the main
method.
The String[] args parameter allows the program to accept command-line arguments.
This line creates an instance of the Scanner class, which is used to read input from the standard
input stream (usually the keyboard).
5.User Input:
These lines prompt the user to input their weight and height, which are then stored in variables
weight and height, respectively.
6.BMI Calculation Method:
public static double calculateBMI(double weight, double height)
{
return weight / (height * height);
}
This method calculates the BMI using the formula: BMI = weight / (height * height).
It takes two parameters: weight and height, both of type double.
It returns the calculated BMI as a double value.
scanner.close();
CHAPTER 3
CODE
import java.util.Scanner;
CHAPTER 4
OUTPUT
OUTPUT 1:
OUTPUT 2: