1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42:
| var Form1: TForm1; var eng,ma,de,lat,franz,span,bio,ch,ph,poli,ge,edk,mu,ku,sp,inf,ds,anzahl,gesamt : integer ; notendurchschnitt : real;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); begin eng:=strtoint (edit1.text) ; de:=strtoint (edit2.text) ; ma:=strtoint (edit3.text) ; lat:=StrToIntDef(Edit4.Text,0); franz:=StrToIntDef(Edit5.Text,0); span:=StrToIntDef(Edit6.Text,0); bio:=StrToIntDef(Edit8.Text,0); ch:=StrToIntDef(Edit9.Text,0); ph:=StrToIntDef(Edit10.Text,0); poli:=StrToIntDef(Edit11.Text,0); ge:=StrToIntDef(Edit12.Text,0); edk:=StrToIntDef(Edit13.Text,0); mu:=StrToIntDef(Edit14.Text,0); ku:=StrToIntDef(Edit15.Text,0); sp:=StrToIntDef(Edit16.Text,0); inf:=StrToIntDef(Edit17.Text,0); ds:=StrToIntDef(Edit18.Text,0); anzahl:=18; if lat=0 then anzahl-1; if franz=0 then anzahl-1 ; if span=0 then anzahl-1 ; if ch=0 then anzahl-1 ; if ku=0 then anzahl-1 ; if mu=0 then anzahl-1 ; if ds=0 then anzahl-1 ; if inf=0 then anzahl-1 ; gesamt:=eng+ma+de+lat+franz+span+bio+ch+ph+poli+ge+edk+mu+ku+sp+inf+ds ; notendurchschnitt:=gesamt/anzahl; edit7.text:=floattostr (notendurchschnitt) ; |