unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm3 =
class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Edit9: TEdit;
Label9: TLabel;
Edit10: TEdit;
Edit11: TEdit;
Label10: TLabel;
Label11: TLabel;
Edit12: TEdit;
Label12: TLabel;
Button1: TButton;
Button2: TButton;
Label13: TLabel;
Label14: TLabel;
Edit13: TEdit;
Edit14: TEdit;
Edit8: TEdit;
Edit15: TEdit;
Label8: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
kk1, kk2, kk3, kk4, kk5, kk6, kk7, kk8, kk9, kks, ka1, ka2, ka3 : real;
kkdurchschnitt : real;
kadurchschnitt : real;
notendurchschnitt : real;
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form3: TForm3;
kk1, kk2, kk3, kk4, kk5, kk6, kk7, kk8, kk9, kks, ka1, ka2, ka3 : real;
kkdurchschnitt : real;
kadurchschnitt : real;
notendurchschnitt : real;
implementation
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
begin
Edit1.Clear;
Edit2.Clear;
Edit3.Clear;
Edit4.Clear;
Edit5.Clear;
Edit6.Clear;
Edit7.Clear;
Edit8.Clear;
Edit9.Clear;
Edit10.Clear;
Edit11.Clear;
Edit12.Clear;
Edit13.Clear;
Edit14.Clear;
Edit15.Clear;
end;
procedure TForm3.Button2Click(Sender: TObject);
var
kk1, kk2, kk3, kk4, kk5, kk6, kk7, kk8, kk9, kks, ka1, ka2, ka3, kas : real;
kkdurchschnitt : real;
kadurchschnitt : real;
notendurchschnitt : real;
begin
if edit1.text='
'
then edit1.Text:= '
0';
if edit2.text='
'
then edit2.Text:= '
0';
if edit3.text='
'
then edit3.Text:= '
0';
if edit4.text='
'
then edit4.Text:= '
0';
if edit5.text='
'
then edit5.Text:= '
0';
if edit6.text='
'
then edit6.Text:= '
0';
if edit7.text='
'
then edit7.Text:= '
0';
if edit8.text='
'
then edit8.Text:= '
0';
if edit15.text='
'
then edit15.Text:= '
0';
//
//
if edit15.text='
0'
then edit13.Text := '
8';
if edit8.text='
0'
then edit13.Text := '
7';
if edit7.text='
0'
then edit13.text := '
6';
if edit6.text='
0'
then edit13.text := '
5';
if edit5.text='
0'
then edit13.text := '
4';
if edit4.text='
0'
then edit13.text := '
3';
if edit3.text='
0'
then edit13.text := '
2';
if edit2.text='
0'
then edit13.text := '
1';
if edit1.text='
0'
then edit13.text := '
0';
kk1 := strtofloat(edit1.text);
kk2 := strtofloat(edit2.text);
kk3 := strtofloat(edit3.text);
kk4 := strtofloat(edit4.text);
kk5 := strtofloat(edit5.text);
kk6 := strtofloat(edit6.text);
kk7 := strtofloat(edit7.text);
kk8 := strtofloat(edit8.text);
kk9 := strtofloat(edit15.text);
//
if edit9.text='
'
then edit9.Text:= '
0';
if edit10.text='
'
then edit10.Text := '
0';
if edit11.text='
'
then edit11.Text := '
0';
if edit11.text='
0'
then edit14.text := '
2';
if edit10.text='
0'
then edit14.text := '
1';
if edit9.text='
0'
then edit14.text := '
0';
ka1 := strtofloat(edit9.text);
ka2 := strtofloat(edit10.text);
ka3 := strtofloat(edit11.text);
kas := ka1 + ka2 + ka3;
kks := kk1+ kk2+ kk3+ kk4+ kk5+ kk6+ kk7+ kk8+ kk9;
//
Label13.Caption := floattostr(kks);
Label14.Caption := floattostr(kas);
kkdurchschnitt := kks/ strtofloat(edit13.text);
kadurchschnitt := kas/ strtofloat(edit14.text);
notendurchschnitt := kkdurchschnitt*(2/3)+kadurchschnitt*(1/3);
Edit12.Text := floattostr (notendurchschnitt);
end;
end.