unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm2 =
class(TForm)
RGGender: TRadioGroup;
LHeight: TLabel;
LWeight: TLabel;
EHeight: TEdit;
EWeight: TEdit;
BAnswer: TButton;
BEnd: TButton;
procedure BAnswerClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
IdealHigh: Real;
IdealLow: Real;
implementation
{$R *.dfm}
procedure TForm2.BAnswerClick(Sender: TObject);
begin
if RGGender.ItemIndex = 0
then // einfach nicht beachten ist nur zur Geschlechtsfeststellung//
IdealHigh:= StrToFloat(EHeight.Text) - 100;
IdealHigh:= IdealHigh * 0.97;
IdealLow:= StrToFloat(EHeight.Text) - 100;
IdealLow:= IdealLow * 0.93;
if IdealHigh < StrToFloat(EWeight.Text)
then
ShowMessage ('
Sie haben Übergewicht!')
else if IdealLow > StrToFloat(EWeight.Text)
then
ShowMessage ('
Sie haben Untergewicht!')
else if (IdealHigh >= StrToFloat(EWeight.Text))
and
(IdealLow <= StrToFloat(EWeight.Text))
then
ShowMessage ('
Sie haben Idealgewicht!');
end;
end.