unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
edt1: TEdit;
edt2: TEdit;
edt3: TEdit;
lbl1: TLabel;
btn1: TButton;
lbl2: TLabel;
lbl3: TLabel;
lbl4: TLabel;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var
lbl2, lbl3, lbl4 :
string;
stimme1, stimme2, Stimme3, Summe :Integer;
prozent1, prozent2, prozent3 :Real;
s1, s2, s3 :
string;
procedure Klassensprecher;
begin
stimme1:=StrToInt('
10');
stimme2:=StrToInt('
10');
stimme3:=StrToInt('
10');
summe:= stimme1+stimme2+stimme3;
prozent1:=stimme1/summe * 100;
prozent2:=stimme2/summe *100;
prozent3:=Stimme3/summe * 100;
s1:=FloatToStr(prozent1);
s2:=FloatToStr(prozent2);
s3:=FloatToStr(prozent3);
lbl2.caption:=s1;
lbl3.caption:=s2;
lbl3.caption:=s3;
end;
procedure TForm1.btn1Click(Sender: TObject);
begin
begin
Klassensprecher;
end;
end;