You are on page 1of 18

P K TECHNICAL CAMPUS, CHAKAN

A MICRO-PROJECT REPORT ON
“BMI Calculator”

SUBMITED BY:-
RUTIK THAKARE

ENROLLMENT NO:-
2216620128

UNDER GUIDANCE OF
Prof mrs. SHRADDHA PARDESHI
THIS IS CERTIFY THAT THE MICROPROJECTIS
SUCCESSFULLY SUBMITTED BY,

• Rutik Thakare

MRS. SHRADDHA HEAD OF THE


PARDESHI MA’AM DEPARTMEN
1. Title of the Microproject:
“BMI Calucator”

2. Aim of the Microproject :-


BMI is a reliable indicator of body fatness for most
people. It is used to screen for weight categories that may
lead to health problems.

3. Course Outcomes :-
1) Configure Android environment and development
tools.
2) Develop rich user Interfaces by using layouts and
controls.
3) Use User Interface components for android
application development

4. Proposed Methodology :-
At first we created a group of 4 members for making
project. After that We collected rough data for making a
project. Then studied carefully on that collected data
and implement in our project respectively.
5. Resources required :-

No Resource Specification
1 Websites www.w3schools.com
www.tutorialspoint.com
www.javatpoint.com

2 Books We used various books like E John Horton


mobile application development book, Thinking
in android bookfor building a project So that we
get various data related to program from it.

3 Teacher Prof. Mundada mam provides lots of


guidance information like topic selection, idea for
building a project. So it becomes easy to
make project.
1. Rationale :-

BMI is an estimate of body fat and a good gauge of your


risk for diseases that can occur with more body fat. The
higher your BMI, the higher your risk for certain
diseases such as heart disease, high blood pressure,
type 2 diabetes, gallstones, breathing problems, and
certain cancers.

2. Aim of the Microproject :-


BMI is a reliable indicator of body fatness for most
people. It is used to screen for weight categories that may
lead to health problems.

3. Course Outcomes :-

1) Configure Android environment and development


tools.

2) Develop rich user Interfaces by using layouts and


controls.

5
3) Use User Interface components for android
application development.

4. Literature Review :-

The body mass index (BMI) is that the metric currently


in use for outlining anthropometric height and weight
characteristics in adults and for classifying them into
groups. The common interpretation is that it represents
an index of
an individual’s fatness. It is also widely used as a risk
factor for the event of or the prevalence of several
health issues.
The Body Mass Index (BMI) Calculator App is a software
programme that eliminates the need for more manual
hours to calculate
and locate the BMI for a specific person with a single
click. This application incorporates both American and
Indian standards.
This app provides all of the information in both
standards that is not available in any other app. The
major goal is to keep one's
health in good shape. The BMI App provides us with all
of the necessary information, such as health
recommendations and advice
on what to eat and what to avoid.

6
5. Code

activity_main.xml

<?xml version="1.0" encoding="utf−8"?>


<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/a
ndroid"
xmlns:app="http://schemas.android.com/apk/res−
auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:background="@drawable/background"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BMI Calculater"
android:textSize="45sp"
android:textColor="#ffff"
android:layout_marginBottom="20dp"
android:textStyle="bold"></TextView>
<LinearLayout
7
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginBottom="20dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Weight"
android:textSize="30sp"
android:textColor="#ffff"
></TextView>
<EditText
android:id="@+id/edweg"
android:layout_width="95dp"
android:layout_height="55dp"
android:inputType="numberDecimal"
android:background="#ffff"
android:textSize="25sp"
android:hint="KG"
android:gravity="center"
android:layout_marginLeft="80dp"></EditText>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"

8
android:layout_marginBottom="20dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Height"
android:textSize="30sp"
android:textColor="#ffff"
></TextView>
<EditText
android:id="@+id/edhei"
android:layout_width="95dp"
android:layout_height="55dp"
android:inputType="numberDecimal"
android:background="#ffff"
android:textSize="25sp"
android:hint="cm"
android:gravity="center"
android:layout_marginLeft="80dp"></EditText>
</LinearLayout>

<Button
android:id="@+id/btnres"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="Result"
android:background="@drawable/custombutton"
android:textSize="25sp"

9
android:textColor="#000"
android:textStyle="bold"
android:layout_marginTop="30dp"
></Button>
<TextView
android:id="@+id/txtinter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter Your Detail "
android:textSize="25sp"
android:textStyle="bold"
android:textColor="#ffff"
android:layout_marginTop="30dp"></TextView>
<TextView
android:id="@+id/txtres"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="BMI = ? "
android:textSize="25sp"
android:textStyle="bold"
android:textColor="#ffff"
android:layout_marginTop="30dp"></TextView>

<Button
android:id="@+id/btnreset"
android:layout_width="120dp"
android:layout_height="60dp"
android:text="Reset"

10
android:background="@drawable/custombutton"
android:textSize="25sp"
android:textColor="#000"
android:textStyle="bold"
android:layout_marginTop="30dp"
></Button>

</LinearLayout>

Main_Activity.java

package com.example.bmicalculater;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

11
final EditText edWeg,edHei;
final TextView txtRes,txtInter;
Button btnRes,btnReset;

edWeg=(EditText) findViewById(R.id.edweg);
edHei= (EditText) findViewById(R.id.edhei);

txtInter=(TextView) findViewById(R.id.txtinter);
txtRes=(TextView) findViewById(R.id.txtres);

btnRes= (Button) findViewById(R.id.btnres);


btnReset= (Button) findViewById(R.id.btnreset);

btnRes.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v) {

String strweg= edWeg.getText().toString();


String strhei= edHei.getText().toString();

if(strweg.equals("")){
edWeg.setError("Please Enter Your Weight
");
edWeg.requestFocus();
return;
}

12
if(strhei.equals("")){
edHei.setError("Please Enter Your Height");
edHei.requestFocus();
return;
}

float weight = Float.parseFloat(strweg);


float height = Float.parseFloat(strhei)/100;

float bmiVlaue = BMICalculate(weight,height);

txtInter.setText(interpreteBMI(bmiVlaue));
txtRes.setText("BMI= "+bmiVlaue);

}
});
btnReset.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v) {
edHei.setText("");
edWeg.setText("");
txtInter.setText("");
txtRes.setText("");
}
});

13
}
public float BMICalculate(float weight,float height){
return weight / (height * height);
}
public String interpreteBMI(float bmiValue){
if( bmiValue <16){
return "Servely Underweight";
}
else if(bmiValue <18.5){
return "Underweight";
}
else if(bmiValue < 25){
return "Normal";
}
else if(bmiValue <30){
return "OverWeight";
}
else
return "Obese";
}
}

14
5. Output :-

Main Interface of the app.

15
Entering the value in empy fileds.

16
Actual Ouput with BMI value.

17
6.0) Conclusion:-

BMI is a reasonable indicator of body fat for both adults and children.
Because BMI does not measure body fat directly, it should not be
used as a diagnostic tool.

18

You might also like