DEV Community

Cover image for BMI & Body Fat Percentage Calculator
Sudhanshu Ambastha
Sudhanshu Ambastha

Posted on • Updated on

BMI & Body Fat Percentage Calculator

The BMI Calculator is a user-friendly Java program crafted to swiftly compute Body Mass Index (BMI), body fat percentage, and provide pertinent BMI and body fat categories based on user-provided data for height, weight, age, and gender.

Technologies Used
My Skills

Usage

  1. Compile the BMICalculator.java file.
  2. Run the compiled Java program.
  3. Input the requested information when prompted:
    • Height (in inches)
    • Weight (in kilograms)
    • Age (in years)
    • Gender (male or female)

Calculations & Categories

  1. BMI Calculation: weight / (height^2), where height is in meters and weight is in kilograms.
  2. Body Fat Percentage Calculation:
  • For adults (18 years and above):

    • Male: (1.20 * BMI) + (0.23 * Age) - 16.2
    • Female: (1.20 * BMI) + (0.23 * Age) - 5.4
  • For adolescents (below 18 years old):

    • Male: (1.51 * BMI) - (0.70 * Age) - 2.2
    • Female: (1.51 * BMI) - (0.70 * Age) + 1.4

Example Input & Output

  • Input:

    • Height (in inches): 72
    • Weight (in kilograms): 80
    • Age (in years): 30
    • Gender: Male
  • Output:

    • BMI: 23.92
    • BMI Category: Normal Weight
    • Body Fat %: 19.4%
    • Body Fat Category: Average

Resources

This BMI and body fat percentage calculator has garnered 2 stars, 43 clones, and 52 views, making it a popular tool for health-conscious individuals seeking quick and reliable body metrics assessment. Give it a try and stay informed about your body composition! While many have cloned my projects, only a few have shown interest by granting them a star. Plagiarism is bad, and even if you are copying it, just consider giving it a star.

Top comments (0)