SHARE
TWEET

Untitled

a guest Dec 6th, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
  9.  
  10. type
  11.  
  12.   { TForm1 }
  13.  
  14.   TForm1 = class(TForm)
  15.     Button1: TButton;
  16.     Edit1: TEdit;
  17.     Edit2: TEdit;
  18.     Edit3: TEdit;
  19.     Edit4: TEdit;
  20.     Edit5: TEdit;
  21.     Edit6: TEdit;
  22.     Edit7: TEdit;
  23.     Label1: TLabel;
  24.     Label10: TLabel;
  25.     Label2: TLabel;
  26.     Label3: TLabel;
  27.     Label4: TLabel;
  28.     Label5: TLabel;
  29.     Label6: TLabel;
  30.     Label7: TLabel;
  31.     Label8: TLabel;
  32.     Label9: TLabel;
  33.     Memo1: TMemo;
  34.     Memo2: TMemo;
  35.     procedure Button1Click(Sender: TObject);
  36.     procedure Memo1Change(Sender: TObject);
  37.     procedure Memo2Change(Sender: TObject);
  38.   private
  39.     { private declarations }
  40.   public
  41.     { public declarations }
  42.   end;
  43.  
  44. var
  45.   Form1: TForm1;
  46.   nmax,nmin,k,kd,i:Integer;
  47.   a:array [1..10] of real;
  48.   max,min,s:real;
  49.  
  50.  
  51.  
  52. implementation
  53.  
  54. {$R *.lfm}
  55.  
  56. { TForm1 }
  57.  
  58. procedure TForm1.Memo2Change(Sender: TObject);
  59. begin
  60.  
  61. end;
  62.  
  63. procedure TForm1.Button1Click(Sender: TObject);
  64. begin
  65.   s:=0; k:=0; kd:=0; max:=a[1];
  66.   for i:=1 to 10 do
  67.    begin
  68.    a[i]:=StrToFloat(Memo2.Lines[i-1]);
  69.   s:=s+a[i];
  70.    if a[i]>=10 then k:=k+1;
  71.    if (a[i]>=7) and (a[i]<10)then kd:=kd+1;
  72.    if max<a[i] then
  73.    begin
  74.    max:=a[i];nmax:=i;
  75.    end
  76.  
  77.  
  78.    end;
  79.    min:=a[1];
  80.    for i:=1 to 10 do
  81.     begin
  82.     if min>a[i] then
  83.     begin
  84.     min:=a[i]; nmin:=i;
  85.     end;
  86.     end;
  87.  
  88.    Edit1.Text:=FloatToStrf(s/10,ffgeneral,1,2);
  89.    Edit2.Text:=IntToStr(k);
  90.    Edit3.text:=IntToStr(kd);
  91.    Edit4.Text:=FloatToStr(max);
  92.    Edit5.Text:=FloatToStr(min);
  93.    Edit6.Text:=Memo1.Lines[nmax-1];
  94.    Edit7.Text:=Memo1.Lines[nmin-1];
  95.  
  96. end;
  97.  
  98. procedure TForm1.Memo1Change(Sender: TObject);
  99. begin
  100.  
  101. end;
  102.  
  103. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top