reference documents for mini projects
reference documents for mini projects
“BMI CALCULATOR”
Submitted in the partial fulfillment of the requirement for the award degree
of
BACHELOR OF ENGINEERING
in
COMPUTER SCIENCE & ENGINEERING
Submitted By
ABC
Prof. of CSE Dept.
AIEMS, Bengaluru.
CERTIFICATE
This is to certify that the mini project report entitled “SOLAR SYSTEM” is a
Bonafide project work carried out by ABC (1AR20CS) and ABC (1AR20CS) in
partial fulfilment of award of Degree of Bachelor of Engineering in Computer Science
and Engineering of Visvesvaraya Technological University, Belagavi, during the
academic year 2022-2023. It is certified that all corrections/suggestions indicated for
Internal Assessment have been incorporated. The mini project has been approved as it
satisfies the academic requirements associated with the Degree mentioned.
…………………… …………………
ABC ABC
Prof., of CSE Dept., Prof., of CSE Dept.,
AIEMS, Bengaluru. AIEMS, Bengaluru.
………………… …………………
ABC
ABC
Head, Dept. of CSE Principal
AIEMS, Bengaluru AIEMS, Bengaluru
ACKNOWLEDGEMENT
The completion of project brings with great sense of satisfaction, but it is never completed
without thanking the persons who all are responsible for its successful completion. First
and foremost, I wish to express my deep sincere feelings of gratitude to our Institution,
AMRUTA INSTITUTE OF ENGINEERING & MANAGEMENT SCIENCES, for
Providing me an opportunity to do my education.
I express my special in-depth, heartfelt, sincere gratitude to project Prof. Guide Name
Professor of CS&E, AMRUTA INSTITUTE OF ENGINEERING & MANAGEMENT
SCIENCES, for his constant support.
Finally, I would like to thank all the Teaching, Technical faculty and supporting staff
members of Department of Computer Science and Engineering, AMRUTA INSTITUTE
OF ENGINEERING & MANAGEMENT SCIENCES, for their support.
ABC
(1AR20CS)
ABC
(1AR20CS)
i
DECLARATION
ABC (1AR20CS) & ABC (1AR20CS) student of sixth semester Bachelor of Engineering in
the Department of Computer Science and Engineering of AMRUTA INSTITUTE OF
ENGINEERING & MANAGEMENT SCIENCES,
BIDADI, bengaluru-562109, Karnataka , hereby declare that the project entitled “BMI
CALCULATOR” has been carried out by me under the guidance and supervision of
Engineering, AIEMS, Bengaluru, submitted in the fulfilment of the requirements for the
course requirements for the award of the degree of Bachelor of Engineering of Computer
year 2022-23.
Place:
Date:
ABC
(1AR20CS009
)
ABC
(1AR20CS012)
ii
INDEX
Chapters Content Page no.
Acknowledgement i
Declaration ii
1 Introduction 1
1.1 Problem Statement 1
1.2 Scope 1
1.3 Project Description 2
4 Implementation 10
6 Future Enhancement 36
7 Conclusion 38
8 Bibliography 39
BMI CALCULATOR 2022-23
CHAPTER 1
INTRODUCTION
1.2 Scope
Becoming overweight should be avoided by everyone. But for persons with disabilities
becoming overweight is a strict NO! Those extra kilos on your body can make you even
more disabled. Increased weight will not just hamper your mobility, but also it will cause
problems to your bones and muscles. And then those risks of diabetes, hypertension and
stroke etc. are also there to cause problems. You can always keep an eye on your weight
by regularly using a weighing machine. But how exactly would you know How would
you know if you’re overweight or obese? Well, Body Mass Index (BMI) is one ofthe
globally accepted standards of defining obesity.
Dept. Of CS&E,
AIeMS Page | 1
BMI CALCULATOR 2022-23
Body mass index: A key index for relating weight to height. Abbreviated BMI. BMI is a
person's weight in kilograms (kg) divided by his or her height in meters squared. The
National Institutes of Health (NIH) now defines normal weight, overweight, and
obesity according to BMI rather than the traditional height/weight charts.
Overweight is a BMI of 27.3 or more for women and 27.8 or more for men.
A very muscular person might have a high BMI without health risks.
Dept. Of CS&E,
AIeMS Page | 2
BMI CALCULATOR 2022-23
CHAPTER 2
8 GB DDR4 memory.
Core CPU processor with minimum 1.6 GHz or x86_64 CPU architecture; 2ndgeneration
Intel Core or newer, or AMD CPU with support for a Windows Hypervisor.
Graphic Accelerators: NVidia or ATI with support of OpenGL 1.5 or higher.
USB Mouse.
Dept. Of CS&E,
AIeMS Page | 3
BMI CALCULATOR 2022-23
CHAPTER 3
DESIGN
3.1 SYSTEM DESIGN
JAVA
Android applications are developed using the Java language. As of now, that’s really
only option for native applications. Java is a very popular programming language
developed by Sun Microsystems (now owned by Oracle). Developed long after C and C+
+, Java incorporates many of the powerful features of those powerful languages while
addressing some of their drawbacks. Still, programming languages are only as powerful
as their libraries. These libraries exist to help developers build applications.
Some of the Java’s important core features are:
It’s object-oriented
Android relies heavily on these Java fundamentals. The Android SDK includes many
standard Java libraries (data structure libraries, math libraries, graphics libraries,
networking libraries and everything else you could want) as well as special Android
libraries that will help you develop awesome Android applications.
The body mass index (BMI) is a method of assessing whether a person is a healthy weight
in relation to their height. Some experts call it the Queenlet index. Using the
person'sheight and weight, BMI indicates whether an individual is underweight, a healthy
weight, overweight, or obese. BMI has become the standard method for assessing body
weight in many countries across the world. However, there are some Where using BMI
may not be appropriate or accurate.
Dept. Of CS&E,
AIeMS Page | 4
BMI CALCULATOR 2022-23
Everyone wants to have an ideal body weight. However, there are many people who do
not know whether they are ideal or not. People usually weight themselves to know
theirweight status. However, there is a better way that is using Body Mass Index or better
knownas BMI. If you know your body mass index, you will know whether you are ideal
or not. Therefore, this is the better site to calculate your weight or health status.
Dept. Of CS&E,
AIeMS Page | 5
BMI CALCULATOR 2022-23
Body mass index relates to height and weight It is classified into 4 different categories.
The first category is underweight. People belong to underweight category if they have
less than
18.5 BMI. The second category is normal weight. People belong to normal weight
category if their BMI is in the range from 18.5 to 24.9. The third categoryis overweight
where people’s BMI is in the range from 25 to 29.9. The last one is obese where people’s
BMI is 30 or higher. If you know how to calculate Body Mass Index (BMI),you will
know what you belong to.
Being overweight increases the risk of a number of serious diseases and healthconditions.
Below is a list of said risks, according to the Centers for Disease Control and Prevention
(CDC):
Higher levels of LDL cholesterol, which is widely considered "bad cholesterol, lower
levels of HDL cholesterol, considered to be good cholesterol in moderation, and
highlevels of triglycerides
Type II diabetes
Stroke
Gallbladder disease
Dept. Of CS&E,
AIeMS Page | 6
BMI CALCULATOR 2022-23
Generally, an increased risk of mortality compared to those with a healthy BMI As can be
seen from the list above, there are numerous negative, in some cases fatal, outcomes that
may result from being overweight. Generally, a person should try to maintain BMI below
25 kg/m2,but ideally should consult their doctor to determine whether or Northey need to
make any changes to their lifestyle in order to be healthier.
Osteoporosis, a disease that causes bone weakness, increasing the risk of breakinga bone
A decrease in immune function
Possible reproductive issues for women due to hormonal imbalances that can disrupt the
menstrual cycle. Underweight women also have a higher chance of miscarriage in the
first trimester
Potential complications as a result of surgery
Dept. Of CS&E,
AIeMS Page | 7
BMI CALCULATOR 2022-23
Here is a BMI Calculator which collects submitter name, age, gender information with
their height and weight measurements and provides them with their body measurement
index and body type information. The template can be used both by individuals who
would like to measure their BMI score and also by dietitians to track their patient
records.
Dept. Of CS&E,
AIeMS Page | 8
BMI CALCULATOR 2022-23
Body mass index, or BMI, is a measure of body size. It combines a person’s weightwith
their height. The result of BMI measurement can give an idea about whether aperson has
the correct weight for their height.
Dept. Of CS&E,
AIeMS Page | 9
BMI CALCULATOR 2022-23
CHAPTER 4
IMPLEMENTATION
Mainactivity.java
package com.tarun.bmicalculator;
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import android.content.Intent;import android.os.Bundle;
import android.view.View; import android.widget.Button;
import android.widget.NumberPicker;import
android.widget.TextView; import android.widget.Toast;
importcom.google.android.material.floatingactionbutton.FloatingActionButton;import
java.text.DecimalFormat;
public class MainActivity extends AppCompatActivity implementsView.OnClickListener
{
CardView weightCardView;CardView ageCardView;
TextView weightCounterText, ageCounterText,
height_title_text;FloatingActionButton weightBtnInc, ageBtnInc;
FloatingActionButton weightBtnDec,
ageBtnDec; int weightCounter = 50;int
ageCounter = 25; String countWeight, countAge;
NumberPicker feetPicker, inchPicker;int feetValue = 5 , inchValue = 4; Button
calculateBtn;
Dept. Of CS&E,
AIeMS Page | 10
BMI CALCULATOR 2022-23
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView(R.layout.activity_main); weightCardView =
findViewById(R.id.weight_cardView); ageCardView =
findViewById(R.id.age_cardView); weightCounterText =
findViewById(R.id.weight_counter_text); ageCounterText =
findViewById(R.id.age_counter_text); weightBtnInc =
findViewById(R.id.weight_btn_inc);
weightBtnDec =
findViewById(R.id.weight_btn_dec); ageBtnInc =
findViewById(R.id.age_btn_inc); ageBtnDec =
findViewById(R.id.age_btn_dec); feetPicker =
findViewById(R.id.feet_picker); inchPicker =
findViewById(R.id.inch_picker);
height_title_text =
findViewById(R.id.height_title_text); calculateBtn =
findViewById(R.id.calculate_btn); counterInit();
decimalFormat = new
DecimalFormat(".#");
weightCardView.setOnClickListener(this);
ageCardView.setOnClickListener(this);
weightBtnInc.setOnClickListener(this);
weightBtnDec.setOnClickListener(this);
ageBtnInc.setOnClickListener(this);
ageBtnDec.setOnClickListener(this);
feetPicker.setOnValueChangedListener(
new NumberPicker.OnValueChangeListener() {@Override
public void onValueChange(NumberPicker picker, int oldVal, int newVal)
{ feetValue = newVal;
heightValueIs();
Dept. Of CS&E,
AIeMS Page | 11
BMI CALCULATOR 2022-23
}
});
inchPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
{ @Override
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {inchValue
= newVal;
heightValueIs();
}
});
calculateBtn.setOnClickListener(new View.OnClickListener()
{@Override public void onClick(View v) {calculateBmi();
}
});
}
@Override
public void onClick(View v) {switch (v.getId())
{
case R.id.weight_cardView:
break;
case R.id.weight_btn_inc:if(weightCounter < 700) weightCounter+
+; countWeight = Integer.toString(weightCounter);
weightCounterText.setText(countWeight); break;
case R.id.weight_btn_dec:if(weightCounter > 0)
weightCounter--; countWeight =
Integer.toString(weightCounter);
weightCounterText.setText(countWeight);break;
case R.id.age_cardView:
break;
case R.id.age_btn_inc:
Dept. Of CS&E,
AIeMS Page | 12
BMI CALCULATOR 2022-23
if(ageCounter <
150) ageCounter++;
countAge =
Integer.toString(ageCounter);
ageCounterText.setText(countAge);
break;
case
R.id.age_btn_dec:
if(ageCounter > 1)
ageCounter--;
countAge =
Integer.toString(ageCounter);
ageCounterText.setText(countAge);
break;
}
}
Dept. Of CS&E,
AIeMS Page | 13
BMI CALCULATOR 2022-23
Dept. Of CS&E,
AIeMS Page | 14
BMI CALCULATOR 2022-23
ACTIVITY_MAIN.XML
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android
" 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"
tools:context=".MainActivity"
android:background="@color/background">
<TextView
android:id="@+id/title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content
" android:layout_marginTop="14dp"
Dept. Of CS&E,
AIeMS Page | 15
BMI CALCULATOR 2022-23
android:fontFamily="sans-serif-condensed-light"
android:text="@string/title_text"
android:textAppearance="@style/TextAppearance.AppCompat.Display1
" android:textColor="@color/text_color"
android:textSize="36sp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.cardview.widget.CardView
android:id="@+id/weight_cardView"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_marginStart="12dp"
android:layout_marginTop="76dp"
android:background="@color/bg_layer_2"
app:cardCornerRadius="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title_text"
>
<androidx.constraintlayout.widget.ConstraintLayou
t android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_layer_2">
<TextView
android:id="@+id/weight_counter_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="@string/weight_counter_txt"
android:textAlignment="center"
android:textColor="@color/text_color"
Dept. Of CS&E,
AIeMS Page | 16
BMI CALCULATOR 2022-23
android:textSize="60sp"
Dept. Of CS&E,
AIeMS Page | 17
BMI CALCULATOR 2022-23
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/weight_title_text" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:padding="8dp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<com.google.android.material.floatingactionbutton.FloatingActionButto
n android:id="@+id/weight_btn_inc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
app:backgroundTint="@color/bg_layer_3
" app:maxImageSize="35dp"
app:srcCompat="@drawable/ic_add"
tools:layout_editor_absoluteX="32dp"
tools:layout_editor_absoluteY="128dp" />
<View
android:layout_width="20dp"
android:layout_height="0dp" />
<com.google.android.material.floatingactionbutton.FloatingActionButto
n android:id="@+id/weight_btn_dec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundTint="@color/bg_layer_3"
Dept. Of CS&E,
AIeMS Page | 18
BMI CALCULATOR 2022-23
app:maxImageSize="35dp"
app:srcCompat="@drawable/ic_remove"
tools:layout_editor_absoluteX="120dp"
tools:layout_editor_absoluteY="128dp" /
>
</LinearLayout>
<TextView
android:id="@+id/weight_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/weight_title_txt"
android:textColor="@color/text_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/age_cardView"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_marginTop="76dp"
android:layout_marginEnd="12dp"
android:background="@color/bg_layer_2"
android:visibility="visible"
app:cardCornerRadius="20dp"
app:layout_constraintEnd_toEndOf="parent
"
app:layout_constraintTop_toBottomOf="@+id/title_text">
<androidx.constraintlayout.widget.ConstraintLayou
Dept. Of CS&E,
AIeMS Page | 19
BMI CALCULATOR 2022-23
t android:layout_width="match_parent"
android:layout_height="match_parent"
Dept. Of CS&E,
AIeMS Page | 20
BMI CALCULATOR 2022-23
android:background="@color/bg_layer_2">
<TextView
android:id="@+id/age_counter_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="@string/age_counter_txt"
android:textAlignment="center"
android:textColor="@color/text_color"
android:textSize="60sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.505"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:padding="8dp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<com.google.android.material.floatingactionbutton.FloatingActionButto
n android:id="@+id/age_btn_inc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
app:backgroundTint="@color/bg_layer_3
" app:maxImageSize="35dp"
app:srcCompat="@drawable/ic_add"
Dept. Of CS&E,
AIeMS Page | 21
BMI CALCULATOR 2022-23
tools:layout_editor_absoluteX="32dp"
tools:layout_editor_absoluteY="128dp" /
>
<View
android:layout_width="20dp"
android:layout_height="0dp" />
<com.google.android.material.floatingactionbutton.FloatingActionButto
n android:id="@+id/age_btn_dec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundTint="@color/bg_layer_3
" app:maxImageSize="35dp"
app:srcCompat="@drawable/ic_remove"
tools:layout_editor_absoluteX="120dp"
tools:layout_editor_absoluteY="128dp" />
</LinearLayout>
<TextView
android:id="@+id/age_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/age_title_txt"
android:textColor="@color/text_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent
"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /
>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardVie
Dept. Of CS&E,
AIeMS Page | 22
BMI CALCULATOR 2022-23
w
android:id="@+id/height_cardView"
android:layout_width="334dp"
Dept. Of CS&E,
AIeMS Page | 23
BMI CALCULATOR 2022-23
android:layout_height="220dp"
android:layout_marginTop="32dp"
android:background="@color/bg_layer_2"
app:cardCornerRadius="22dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent
"
app:layout_constraintTop_toBottomOf="@+id/weight_cardView">
<androidx.constraintlayout.widget.ConstraintLayou
t android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_layer_2">
<TextView
android:id="@+id/height_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/height_title_txt"
android:textColor="@color/text_color"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502
"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent
"
app:layout_constraintTop_toBottomOf="@+id/height_title_text">
Dept. Of CS&E,
AIeMS Page | 24
BMI CALCULATOR 2022-23
<androidx.cardview.widget.CardVie
w android:id="@+id/feet_cardView"
Dept. Of CS&E,
AIeMS Page | 25
BMI CALCULATOR 2022-23
android:layout_width="120dp"
android:layout_height="140dp"
android:layout_marginStart="24dp"
android:layout_weight="1"
app:cardCornerRadius="20dp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayou
t android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_layer_3">
<NumberPicker
android:id="@+id/feet_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:theme="@style/NumberPickerTheme"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/feet_title
" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/feet_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="@string/ft"
android:textColor="@color/text_color
" android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
Dept. Of CS&E,
AIeMS Page | 26
BMI CALCULATOR 2022-23
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<View
android:layout_width="24dp"
android:layout_height="0dp" />
<androidx.cardview.widget.CardView
android:id="@+id/inch_cardView"
android:layout_width="120dp"
android:layout_height="140dp"
android:layout_marginEnd="24dp"
android:layout_weight="1"
app:cardCornerRadius="20dp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayou
t android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_layer_3">
<NumberPicker
android:id="@+id/inch_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:theme="@style/NumberPickerTheme
"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/inch_titile
" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Dept. Of CS&E,
AIeMS Page | 27
BMI CALCULATOR 2022-23
<TextView
android:id="@+id/inch_titile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="@string/in"
android:textColor="@color/text_color
" android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/height"
android:textColor="@color/text_color
" android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<Button
android:id="@+id/calculate_btn"
android:layout_width="330dp"
android:layout_height="wrap_content
"
android:layout_marginBottom="24dp"
Dept. Of CS&E,
AIeMS Page | 28
BMI CALCULATOR 2022-23
android:background="@drawable/button_design"
Dept. Of CS&E,
AIeMS Page | 29
BMI CALCULATOR 2022-23
android:text="@string/button_text"
android:textColor="@color/text_color"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
BMIActivity.java
package com.tarun.bmicalculator;
import
androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import
android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
Dept. Of CS&E,
AIeMS Page | 30
BMI CALCULATOR 2022-23
@Override
protected void onCreate(Bundle savedInstanceState) {
Dept. Of CS&E,
AIeMS Page | 31
BMI CALCULATOR 2022-23
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bmi);
bmiValue = findViewById(R.id.bmi_value);
bmiCategory =
findViewById(R.id.bmi_category); bmiTips =
findViewById(R.id.bmi_tips);
bmiTipsArray =
getResources().getStringArray(R.array.tips_array);
calculateAgainBtn = findViewById(R.id.calculate_again_btn);
bmiValOutput = getIntent().getStringExtra("bmiVal");
bmiValue.setText(bmiValOutput);
findCategory()
;
categoryTips();
calculateAgainBtn.setOnClickListener(new View.OnClickListener()
{ @Override
public void onClick(View v)
{ onBackPressed();
}
});
}
private void categoryTips() {
double result =
Double.parseDouble(bmiValOutput); if(result < 15)
{
bmiTips.setText(bmiTipsArray[0]);
}
else if(result >= 15 && result <= 16){
bmiTips.setText(bmiTipsArray[0]);
}
else if(result >= 16 && result <= 18.5){
bmiTips.setText(bmiTipsArray[1]);
}
Dept. Of CS&E,
AIeMS Page | 32
BMI CALCULATOR 2022-23
else if(result >= 18.5 && result <= 25){
bmiTips.setText(bmiTipsArray[2]);
}
else if(result >= 25 && result <= 30){
Dept. Of CS&E,
AIeMS Page | 33
BMI CALCULATOR 2022-23
bmiTips.setText(bmiTipsArray[3]);
}
else if(result >=30 && result <= 35){
bmiTips.setText(bmiTipsArray[4]);
}
else if(result >= 35 && result <= 50){
bmiTips.setText(bmiTipsArray[4]);
}
else
bmiTips.setText(bmiTipsArray[4])
;
}
private void findCategory() {
double result =
Double.parseDouble(bmiValOutput); if(result < 15)
{
category = "Very Severely
Underweight";
bmiCategory.setText(category);
}
else if(result >= 15 && result <= 16){
category = "Severely Underweight";
bmiCategory.setText(category);
}
else if(result >= 16 && result <= 18.5){
category = "Underweight";
bmiCategory.setText(category);
}
else if(result >= 18.5 && result <= 25)
{ category = "Normal (Healthy
weight)";
bmiCategory.setText(category);
}
else if(result >= 25 && result <= 30){
Dept. Of CS&E,
AIeMS Page | 34
BMI CALCULATOR 2022-23
category = "Overweight";
bmiCategory.setText(category);
}
Dept. Of CS&E,
AIeMS Page | 35
BMI CALCULATOR 2022-23
else if(result >=30 && result <= 35){
category = "Moderately Obese";
bmiCategory.setText(category);
}
else if(result >= 35 && result <= 50)
{ bmiCategory.setText(category);
category = "Severely Obese";
}
else
category = "Very Severely
Obese";
bmiCategory.setText(category);
}
}
Activity_bmi.XML
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android
" 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"
tools:context=".BmiActivity"
android:background="@color/background">
<TextView android:id="@+id/Bmi_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/YourBmiText"
android:textColor="@color/text_color"
android:textSize="36sp"
android:textStyle="bold"
android:layout_marginTop="36dp"
app:layout_constraintEnd_toEndOf="parent"
Dept. Of CS&E,
AIeMS Page | 36
BMI CALCULATOR 2022-23
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView android:id="@+id/bmi_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="88dp"
android:text="@string/bmiValue"
android:textColor="@color/text_color"
android:textSize="100sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent
"
app:layout_constraintTop_toBottomOf="@+id/Bmi_title" />
<TextView android:id="@+id/bmi_category"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="70dp"
android:textColor="@color/text_color"
android:textSize="26sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bmi_value" /
>
<TextView
android:id="@+id/bmi_tips"
android:layout_width="350dp
"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:text="@string/bmiTips"
Dept. Of CS&E,
AIeMS Page | 37
BMI CALCULATOR 2022-23
android:textAlignment="center"
android:textColor="@color/text_color
"
Dept. Of CS&E,
AIeMS Page | 38
BMI CALCULATOR 2022-23
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bmi_category" />
<Button
android:id="@+id/calculate_again_btn
" android:layout_width="330dp"
android:layout_height="wrap_content"
android:background="@drawable/button_design"
android:text="@string/button2_text"
android:textColor="@color/text_color"
android:textSize="18sp"
android:layout_marginBottom="24dp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Dept. Of CS&E,
AIeMS Page | 39
BMI CALCULATOR 2022-23
CHAPTER 5
In Figure5.1 & 5.2, Being underweight is defined as having a body mass index
(BMI) below 18.5. This is estimated to be less than the body mass needed to sustain
optimal health. Conversely, over 25 is considered overweight and over 30 is
considered obese. Use this calculator to see where you fit on the BMI scale
Dept. Of CS&E,
AIeMS Page | 40
BMI CALCULATOR 2022-23
Figure 5.3: Calculating normal weight Figure 5.4: Normal weight results
In Figure 5.3 & 5.4, Your BMI is, indicating your weight is in the category for
adults of your height. For your height, a normal weight range would be from to
pounds. Maintaining a healthy weight may reduce the risk of chronic diseases
associated with overweight and obesity.
Dept. Of CS&E,
AIeMS Page | 41
BMI CALCULATOR 2022-23
Figure 5.5: Calculating over weight Figure 5.6: Over weight results
In Figure 5.5 & 5.6, overweight is a BMI greater than or equal to 25; and obesityis
a BMI greater than or equal to 30. BMI provides the most useful population- level
measure of overweight and obesity as it is the same for both sexes and for allages
of adults.
Dept. Of CS&E,
AIeMS Page | 42
BMI CALCULATOR 2022-23
Figure 5.7: Calculating moderately Obese Figure 5.8: moderately Obese results
In Figure 5.7 & 5.8, Obesity (BMI ≥ 30 kg/m2) was observed in 8.9% of men and
12.4% of women; for moderate overweight (BMI 25-<30 kg/m2) these percentages
were 42.2% and 30.4% respectively. Obese men and women were more likely to
consult their GP than persons without overweight.
Dept. Of CS&E,
AIeMS Page | 43
BMI CALCULATOR 2022-23
Figure 5.9: Calculating severely obese Figure 5.10: severely obese result
In Figure 5.9 & 5.10, The actual medical definition of morbid obesity is: “A
serious health condition that results from an abnormally high body mass that is
diagnosed by having a body mass index (BMI) greater than 40 kg/m², a BMI of
greater than 35 kg/m² with at least one serious obesity-related condition, or being
more than 100 pounds over ideal body weight (IBW).”.
Dept. Of CS&E,
AIeMS Page | 44
BMI CALCULATOR 2022-23
Figure 5.11: Calculating very severely underweight Figure 5.12: very severely
underweight
In Figure 5.11 & 5.12, Very severely underweight This indicates that your body fat
percentage is in the DANGEROUSLY LOW category. You are VERY
SEVERELY UNDERWEIGHT and should be seen by a healthcare provider for
further assessment to determine possible causes of very severe underweight.
Dept. Of CS&E,
AIeMS Page | 45
BMI CALCULATOR 2022-23
CHAPTER 6
FUTURE ENHANCEMENTS
In future we can add features where user can share their results which each other
and then comparing their results. Giving health advice or tips in scheduled manner
depending on the user results. Providing best workout routine and food tips to be
fit. And a feature where the applicationshows gyms and fitness center near his/her
neighborhood using Google maps API.
Multi-Unit Support: Provide the option to input height and weight in various
measurement units, such as centimeters and kilograms, feet and pounds, etc. This
will make the calculator more versatile and user-friendly for people who are more
comfortable with different unit systems.
Mobile App Integration: Develop a mobile application that integrates the BMI
calculator, providing a seamless user experience. The app could include additional
Dept. Of CS&E,
AIeMS Page | 46
BMI CALCULATOR 2022-23
Integration with Wearable Devices: Sync the BMI calculator with wearable devices
like smartwatches or fitness trackers.
This would enable automatic data input from these devices, making the calculation
process more convenient and accurate. It could also provide real-time feedback and
personalized recommendations based on the user's activity levels.
Dept. Of CS&E,
AIeMS Page | 47
BMI CALCULATOR 2022-23
CHAPTER
48
CONCLUSION
The aim of this project is to demonstrate the working of BMI application. The main
purpose ofthis application is to calculate the Body mass index or BMI of a person.
Body Mass Index (BMI), which is a measure of body fat, calculated using a
formula that requires the height andthe weight of an adult (either man or woman).
Persons with a BMI of less than 18.5 are underweight. A person is of normal
weight if his or her BMI is between 18.5 and 24.9; overweight if the BMI is
between 25 and 29.9; and obese if it is 30 and above. This application is helpful for
the people who are interested in working out and improving their health.
Dept. Of CS&E,
AIeMS Page | 48
BMI CALCULATOR 2022-23
CHAPTER
49
BIBILIOGRAPHY
www.github.com
www.google.com
www.freecodester.com
www.stackoverflow.com
Dept. Of CS&E,
AIeMS Page | 49