Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.59 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  9.   ExtCtrls;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     ATEdit: TEdit;
  17.     Label11: TLabel;
  18.     Label14: TLabel;
  19.     NoteBerechnenButton: TButton;
  20.     Label12: TLabel;
  21.     Label13: TLabel;
  22.     Label9: TLabel;
  23.     Test3Edit: TEdit;
  24.     TestMWEdit: TEdit;
  25.     H1Edit: TEdit;
  26.     GesamtEdit: TEdit;
  27.     Label10: TLabel;
  28.     Label8: TLabel;
  29.     Test1Edit: TEdit;
  30.     Test2Edit: TEdit;
  31.     mdlEdit: TEdit;
  32.     KlausurEdit: TEdit;
  33.     H2Edit: TEdit;
  34.     Label1: TLabel;
  35.     Label2: TLabel;
  36.     Label3: TLabel;
  37.     Label4: TLabel;
  38.     Label6: TLabel;
  39.     Label7: TLabel;
  40.  
  41.     procedure NoteBerechnenButtonClick(Sender: TObject);
  42.  
  43.  
  44.   private
  45.     { private declarations }
  46.   public
  47.     { public declarations }
  48.   end;
  49.  
  50. var
  51.   Form1: TForm1;
  52.   t1,t2,t3,h1,kl,mdl:integer;
  53.   mw,h2,at,gesamt:real;
  54.  
  55. implementation
  56.  
  57. {$R *.lfm}
  58.  
  59. { TForm1 }
  60.  
  61.  
  62.  
  63. procedure TForm1.NoteBerechnenButtonClick(Sender: TObject);
  64. begin
  65.   //Eingabe
  66.   t1  := strtoint(test1edit.text);
  67.   t2  := strtoint(test2edit.text);
  68.   t3  := strtoint(test3edit.text);
  69.   h1  := strtoint(h1edit.text);
  70.   kl  := strtoint(klausuredit.text);
  71.   mdl := strtoint(mdledit.text);
  72.  
  73.   //Verarbeitung
  74.   mw     := (t1+t2+t3)/3;
  75.   at     := (mw+mdl)/2;
  76.   h2     := (at+kl)/2;
  77.   gesamt := (0.25*h1)+(0.75*h2);
  78.  
  79.   //Ausgabe
  80.   testmwedit.text := floattostr(mw);
  81.   atedit.text     := floattostr(at);
  82.   h2edit.text     := floattostr(h2);
  83.   gesamtedit.text := floattostr(gesamt);
  84.  
  85. end;
  86.  
  87. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement