0% found this document useful (0 votes)
21 views

Comprog Final (1)

Uploaded by

peincruz596
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Comprog Final (1)

Uploaded by

peincruz596
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

ANDRES BONIFACIO COLLEGE

SCHOOL OF ENGINEERING
COLLEGE PARK, DIPOLOG CITY

Simple BMI Calculator


Group 2:
Sotto, Junamaicha A.
Arroyo, Estrell Marie P.
Kagatan, Kassandra Kaye D.
Rudas, Aljen Grace L.
Santander, Joyce Angel A.
Tacloban, Reymark D.

TITLE: Body Mass Index Calculator


A. What is your program all about?
Our program is a Body Mass Index (BMI) Calculator and Health Analysis tool, developed in C++. This
program aims to provide users with an easy way to calculate their BMI based on their height and weight.
The program will categorize their BMI results into groups such as underweight, normal weight,
overweight, or obese. It is a valuable tool for anyone interested in understanding their health better by
keeping track of their BMI. The BMI is used to estimate a person’s body fat based on their weight in
relation to their height. It is calculated using the formula BMI = weight (kg) / height (m²). For users who
prefer using pounds and inches, the program will also allow inputs in these units, converting them to
kilograms and centimeters for the calculation. The program features a simple, user-friendly interface,
making it accessible to users with basic computer skills. First, the program prompts the user to input their
weight in kilograms or pounds. Next, the user inputs their height in meters or inches. The program then
calculates the BMI using the appropriate formula and outputs the BMI value along with a message
indicating the BMI category (e.g., underweight, normal, overweight, obese).

B. What is the main purpose of your program?


The main purpose of our program is to promote awareness about personal health by giving users a quick
and easy way to calculate their BMI and understand their weight status. By categorizing BMI results, the
program helps users identify if they are within a healthy weight range or if they may need to make
lifestyle adjustments. These categories are underweight, normal weight, overweight, and obese. It
encourages people to think about their body weight and its impact on health. A BMI calculator can
motivate users to make healthy lifestyle changes if needed. It acts as a simple guide for understanding
weight-related health risks. Although it does not measure body fat directly, it is widely used for general
health assessments. This can be particularly helpful for students, who may not have access to regular
health check-ups. By using units familiar to them, such as pounds and inches, the program can reach a
broader audience. Overall, the program raises awareness about healthy body weight and can start
discussions about diet, exercise, and overall health. This program empowers users to take charge of their
health and adopt healthy habits, potentially leading to a healthier, more informed community.

C. How will your program benefit your group?


Developing the BMI Calculator program will benefit our group by strengthening our knowledge of C++
programming, especially in areas like input/output operations, conditionals, and functions. This project
will also allow us to work on collaborative coding and problem-solving skills. A BMI calculator program
can also benefit our group by promoting awareness of the impact of eating habits on body weight and
overall health. By calculating and monitoring BMI, we can understand how skipping meals like breakfast,
lunch, or dinner might affect our weight. This insight can encourage our group to adopt healthier eating
habits to maintain or achieve a balanced weight. Additionally, knowing our BMI can help identify
potential health risks associated with poor nutrition and irregular meals. It can also start discussions in our
group about planning more balanced meals. Overall, the program serves as a simple tool to track weight
health and motivate better meal practices. Working together on a real-world application provides valuable
experience in project management and teamwork. Through this project, programmers can learn how to
take user input, work with different types of data, and use functions to keep the code organized and
reusable.
D. How will your program benefit the following?
Students: Students will gain a simple tool to calculate and understand their BMI, which could encourage
healthy habits. For those who may be unaware of what BMI (Body Mass Index) is, this program will
provide them with valuable information and insight into their health status. By offering input options in
both metric and imperial units, students can use the system they are most comfortable with, enhancing
usability. Students can also enhance their C++ programming skills, including input/output handling and
conditional statements. This practical application of their coding knowledge can solidify their
understanding and give them confidence in their abilities.

School: The school could use the program as an educational tool, especially in health and physical
education classes. It may also be a tool for the school nurse or health clinic to help assess students’ health
during check-ups or health drives. By raising awareness of BMI and healthy weight, the school can create
a culture that values physical health, nutrition, and fitness among students and staff. The ability to input
weight in pounds and height in inches makes the program versatile and easy to integrate into various
health-related activities within the school.

Community: Community members could use the program to learn more about their health, helping raise
awareness of health issues related to BMI. The program could be used at community events, health fairs,
or public health campaigns to promote general wellness and health awareness. By offering a tool that
accepts both metric and imperial units, the program can cater to a wider audience. Local health
workshops can use the program to engage the community in discussions about nutrition, exercise, and
healthy living. This involvement can foster a community-wide effort towards better health practices.

E. How will your program affect the industry of computer programming?


Our BMI Calculator program shows how programming can create helpful tools for learning about health.
Even though it is simple, it demonstrates how software can make important health information easy to
find and understand. This project highlights the need for user-friendly software that meets people's needs,
like health and wellness. It might inspire other programmers to make more health-related apps that help
people stay healthy and prevent illness. Our program also shows how programming can do calculations
quickly and give clear results, which is useful in healthcare, schools, and public services. By making
these calculations easier, programmers can save time and reduce mistakes. This type of software can help
both individuals and professionals. The inclusion of options for both metric and imperial units
demonstrate the importance of flexibility in software design. Overall, our BMI calculator shows that
programming can make a positive difference in people’s lives. It encourages the development of
technology that helps users live healthier lives. As more programmers create similar tools, the industry
can grow to include more health-focused applications.

Final Code
#include <iostream>
using namespace std;
int main() {
float weight, height, bmi;
int weightUnit, heightUnit;

cout << "Choose weight unit: \n";


cout << "Enter 1 for kilograms (kg)\n";
cout << "Enter 2 for pounds (lbs)\n";
cout << "Enter choice: ";
cin >> weightUnit;

cout << "Choose height unit: \n";


cout << "Enter 1 for meters (m)\n";
cout << "Enter 2 for inches (in)\n";
cout << "Enter choice: ";
cin >> heightUnit;

// Input weight based on selected unit


if (weightUnit == 1) {
cout << "Enter your weight in kilograms: ";
cin >> weight;
} else if (weightUnit == 2) {
cout << "Enter your weight in pounds: ";
cin >> weight;
weight = weight * 0.453592; // pounds to kilograms
} else {
cout << "Invalid choice for weight unit!" << endl;
return 1;
}
// Input height based on selected unit
if (heightUnit == 1) {
cout << "Enter your height in meters: ";
cin >> height;
} else if (heightUnit == 2) {
cout << "Enter your height in inches: ";
cin >> height;
height = height * 0.0254; // inches to meters
} else {
cout << "Invalid choice for height unit!" << endl;
return 1;
}

bmi = weight / (height * height);// Calculates BMI

cout << "Your BMI is: " << bmi << endl; //Outputs calculated BMI

if (bmi < 18.5) {


cout << "Category: Underweight" << endl;
} else if (bmi >= 18.5 && bmi < 24.9) {
cout << "Category: Normal weight" << endl;
} else if (bmi >= 25 && bmi < 29.9) {
cout << "Category: Overweight" << endl;
} else {
cout << "Category: Obese" << endl;
}
return 0;
}

You might also like