❔ Creating a BMI and BMR project
Hey guys, I don't really understand really this project BMI and BMR.
46 Replies
What do you not understand about it?
I don't really know what to do! What's the purpose of the project?
I'm assuming a BMI and BMR calculator
Ok! BMI from what I understood i'ts all about gender, weight, length and age. I think this involves a calculation too.
I need a bit explanation to understand the process
Wikipedia gives you a BMI equation
Ask the user to enter what the equation needs
Print out the result
Ok
I mean is it calculating the weight, length? But what gender and age play role in this senario?
For BMI? They don't
Ok
So in BMI it's all about calculating the weight and the length
?
What does the equation tell you?
Write a program to calculate BMI and BMR for both men and women.
1. BMI
First, the program must calculate the BMI-Body Mass Index. BMI is a measure of the ratio between weight and height.
This measurement is used, among other things, by the WHO (World Health Organization) to define overweight/obesity and should be seen as a guideline.
The formula for calculating BMI is as follows:
BMI = 1.3*weight(kg)/height(m)2.5
The program should print whether the person has a normal weight or not according to the following table.
BMI table
The table below applies to men and women over 18 years of age with a normal build.
BMI under 18.5 underweight
BMI 18.5–25 healthy and normal weight
BMI 25–30 overweight
BMI 30–40 severely overweight
BMI over 40 extreme obesity
2. BMR
Well
It's pretty clear
Well! Not for me 😁
What isn't clear?
The user inputs their height
The user inputs their weight
You calculate the BMI
Ok
Then you check the value of it and print the user's obesity state
If the BMI is 25 to 30, you print
overweight
And so onHere is the important question! By calculating, you mean just multiplying?
Doing the math
Calculating things means doing the math
Whatever that math is
2 + 2 = 4
is calculating
7 * 825346725348i3745
is calculatingAha! Ok!
Ok! Well! BMI seems pretty easy.
Is BMR is the same or is it a bit more complicated logic?
idk
What does the exercise say?
It gave you the equation for the BMI, so I assume it'll also give you one for BMR
Yes, it did.
I can show you, one minute.
It's in Swedish, so I need to translate it to English.
The program will then calculate the BMR-basal metabolic rate. BMR is the daily energy requirement needed to maintain
a person's vital organs at total rest.
One of the formulas that can be used to calculate this is the Mifflin-st Jeor equation:
Men:
BMR (men) = 66.47 + (13.75 × weight in kg) + (5.003 × height in cm) − (6.755 × age in years)
Women:
BMR (women) = 655.1 + (9.563 × weight in kg) + (1.85 × height in cm) − (4.676 × age in years)
Your program should prompt the user to enter their gender, height and weight, and age.
The program must verify that entered values are valid.
50 [cm] ≤ length ≤ 220 [cm] // user's height
10 [kg] ≤ weight ≤ 250 [kg] // user's weight
18 [years] ≤ age ≤ 70 [years] // user's age
The program should then print both bmi and bmr.
Avoid the Swedish vowels äåö to name variables
Cool
You have the equation
So do the calculations
Ok
I will try to write program and if I get stuck somewhere, the I'll get back to you. Thanks a lot bro
I have one more question, would you help me out? Not very big one.
Shoot
Cool, thanks a lot 🤗
I'm building a project for a practice purpose. It's consisted of a bank that loans money to people to buy a house.
First step would be to create/ register an account for a customer.
Since I would have a multiple customers. So I'm thinking about using an array instead of a list, since I've been using lists all the time and need to practice using arrays too.
If you want to have a set amount of customers, sure
If you want to be able to add and remove new ones, not a good idea
Do you think array/ dictionary or list would do it?
Ok! Well! I am going to need to add new customers every time someone applies for a loan, but not removing.
So u think it's better to use lists or dictionaries instead?
ye
Ok! I will go with dictionaries then.
nobody thinks of SortedList 😢
What do you mean by this?
You mean sorting algorithm?
it's sort of kinda like a dictionary (but it's an ordered list of KeyValuePair)
Ah! Ok! This seems new to me, is this belong to LINQ collection?
it's two normal system collections generic and nongeneric types
Aha! Ok! I think I should look that up to see the difference between generic & non-generic.
well one deals only with objects and the other with the type you specify
Ok! That's interesting to know.
Wow! You have built the whole project using pretty much advanced logic than the typical code flow that I usually write so often using only attributes, methods, objects getting user inputs and lists followed with loops.
I wonder how you used different concepts in this project and manage them altogether to produce the output/ result that's expected? I see you're using the following
const
AnsiConsole.MarkupLine =>
different than the regular pattern which's if (a => 10) bla bla
ReadKey()
ReadOnly
enum
you seem like a senior software developer lol.Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.No not yet
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.No
it's a switch expression
Can you help me out in the other thread bro? This project is just distracting me.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.