Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- {$mode objfpc}{$H+}
- interface
- uses
- Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
- ExtCtrls;
- type
- { TForm1 }
- TForm1 = class(TForm)
- ATEdit: TEdit;
- Label11: TLabel;
- Label14: TLabel;
- NoteBerechnenButton: TButton;
- Label12: TLabel;
- Label13: TLabel;
- Label9: TLabel;
- Test3Edit: TEdit;
- TestMWEdit: TEdit;
- H1Edit: TEdit;
- GesamtEdit: TEdit;
- Label10: TLabel;
- Label8: TLabel;
- Test1Edit: TEdit;
- Test2Edit: TEdit;
- mdlEdit: TEdit;
- KlausurEdit: TEdit;
- H2Edit: TEdit;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- procedure NoteBerechnenButtonClick(Sender: TObject);
- private
- { private declarations }
- public
- { public declarations }
- end;
- var
- Form1: TForm1;
- t1,t2,t3,h1,kl,mdl:integer;
- mw,h2,at,gesamt:real;
- implementation
- {$R *.lfm}
- { TForm1 }
- procedure TForm1.NoteBerechnenButtonClick(Sender: TObject);
- begin
- //Eingabe
- t1 := strtoint(test1edit.text);
- t2 := strtoint(test2edit.text);
- t3 := strtoint(test3edit.text);
- h1 := strtoint(h1edit.text);
- kl := strtoint(klausuredit.text);
- mdl := strtoint(mdledit.text);
- //Verarbeitung
- mw := (t1+t2+t3)/3;
- at := (mw+mdl)/2;
- h2 := (at+kl)/2;
- gesamt := (0.25*h1)+(0.75*h2);
- //Ausgabe
- testmwedit.text := floattostr(mw);
- atedit.text := floattostr(at);
- h2edit.text := floattostr(h2);
- gesamtedit.text := floattostr(gesamt);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement