Stuck in my project C# (Bodyfat)

Karam

New member
Joined
Feb 7, 2022
Messages
1
Programming Experience
Beginner
I'm stuck in this project, I need help figuring out how to write these formulas correctly in C# language and make the application run correctly, the idea of prject is to use Visual Studio to create an application where you will calculate a person’s lean body weight, fat mass, percent body fat, and ideal weight.

Women Thirty Years and Younger

hips + (.80 x thigh) – (2 x calf) – wrist = % body fat

Women over Thirty

hips + thigh – (2 x calf) – wrist = % body fat

Men Thirty Years and Younger

waist + (1/2 hips) – (3 x forearm) – wrist = % body fat

Men over Thirty

waist + (1/2 hips) – (2.7 x forearm) – wrist = % body fat

Men

Lean Body Mass (pounds) ÷ 0.85 = correct weight to be 15% fat

Women

Lean Body Mass (pounds) ÷ 0.78 = correct weight to be 22% fat


I have attached screenshot shows where I'm stuck please Help!
33.png
3.png
 
What C# book or tutorial are you using to learn how to program in C#? I am amazed that it didn't cover the basics of doing simple math.
 
You need to look at basic calculations. Your line 50 would be
C#:
 double percentBodyFat = waist + (hips/2)-(forearm*3)-wrist

Of course, that's assuming there is a value in waist, hips, forearm, and wrist. You cannot have a variable start with a % and there cannot be spaces in the variable names. And you are assigning TO a variable so it comes first.

myResultVariable = someCalculation.

You need to splat the instructor around.
 
Back
Top Bottom