![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2005
Posts: 8
Rep Power: 0
![]() |
need a little beginner delphi help please
ok so i need a little help with some delphi programming but i am very new to it. i have just started it in computing class and have only covered very very basic things so far. so here's my problem: i have made a simple bmi calculator and its all good but i was wondering how i could make it choose what type of measurements in the height/weight (like pounds, kilograms, stones etc) with radio buttons? i have everything else pretty much sorted but i have no idea how to start on this. here is how the code currently looks (excuse the crappiness of it):
procedure TForm1.Button1Click(Sender: TObject); var weight:real; var height:real; var height2:real; var bmi:real; var height3:real; begin weight := strtofloat(edit2.text); height := strtofloat(edit1.text); height2 := height / 100; height3 := height2 * height2; bmi := weight / height3; edit3.text :=floattostr(bmi); if bmi >=30 then label4.caption := 'Obese'; if bmi <=18.5 then label4.caption := 'Underweight'; if (bmi >=18.5) and (bmi <=24.9) then label4.caption := 'Normal'; if (bmi >=25) and (bmi <=29.9) then label4.caption := 'Overweight'; end; at the moment i have only got cm option for the height and only kilogram option for the weight but would like to have feet and inches as another option for height and pounds and stones for weight. i have the conversion rates and all but i am unsure what to do to get it to work. any help would be really appreciated and would help me out tonnes. thanks alot |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Jan 2006
Posts: 3
Rep Power: 0
![]() |
Use RadioGroup Component, and use a case statement with the RadioGroup.itemindex
C |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Oct 2005
Posts: 8
Rep Power: 0
![]() |
yeah but i need help in doing that, im very new to this. any ideas what i need to put into it?
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|