O‘quv mashg‘ulotining o‘qitish


Download 4.02 Mb.
bet31/47
Sana02.11.2023
Hajmi4.02 Mb.
#1740794
1   ...   27   28   29   30   31   32   33   34   ...   47
Bog'liq
informatika 120soat To\'plam

Var i,j,cod:integer;
A:array[1..4,1..4] of Real;
S:real; s1:String;
begin
For i:=1 to 4 do
For j:=1 to 4 do
Val(StringGrid1.cells[i-1,j-1],a[i,j],cod);
S:=0;
For i:=1 to 4 do
For j:=1 to 4 do
s:=s+a[i,j];
Str(s:7:2,s1);
Memo1.Clear;
Memo1.Lines.add('Summa ='+s1);
s:=s/4/4;
Str(s:7:2,s1);
Memo1.Lines.add('Ortacha='+s1);
end;
4.Tuzilgan loyiha (proekt) ya’ni Project1 va Unit1 standart modul nomlarini mos nomlar bilan almashtirib saqlaymiz.
5.YAngi nom bilan saqlangan proekt, ya’ni ILOVA F9 tugmachasini bosish bilan ishga tushuriladi.
ILOVA ishga tushirilganda uning quyidagi ko‘rinishi ekranda namayon bo‘ladi.

Tashkil qilingan modulning to‘liq ko‘rinishini keltiramiz.
unit j1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, StdCtrls;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
Button1: TButton;
Label1: TLabel;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
Var i,j,cod:integer;
A:array[1..4,1..4] of Real;
S:real; s1:String;
begin
For i:=1 to 4 do For j:=1 to 4 do
Val(StringGrid1.cells[i-1,j-1],a[i,j],cod);
S:=0;

Download 4.02 Mb.

Do'stlaringiz bilan baham:
1   ...   27   28   29   30   31   32   33   34   ...   47




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling