ΠŸΠΎΠΌΠΎΡ‰ΡŒ Π² написании студСнчСских Ρ€Π°Π±ΠΎΡ‚
АнтистрСссовый сСрвис

Π˜Π·ΡƒΡ‡Π΅Π½ΠΈΠ΅ Ρ€Π°Π±ΠΎΡ‚Ρ‹ с Ρ„Π°ΠΉΠ»Π°ΠΌΠΈ Π½Π° языкС Delphi

Лабораторная Ρ€Π°Π±ΠΎΡ‚Π°ΠŸΠΎΠΌΠΎΡ‰ΡŒ Π² Π½Π°ΠΏΠΈΡΠ°Π½ΠΈΠΈΠ£Π·Π½Π°Ρ‚ΡŒ ΡΡ‚ΠΎΠΈΠΌΠΎΡΡ‚ΡŒΠΌΠΎΠ΅ΠΉ Ρ€Π°Π±ΠΎΡ‚Ρ‹

While (not eof (f)) and (edit4.text<>'') do. If length (istochnik)≥length (chto) then. Procedure Button5Click (Sender: TObject); Procedure Button4Click (Sender: TObject); Procedure Button3Click (Sender: TObject); Procedure Button2Click (Sender: TObject); Procedure Button1Click (Sender: TObject); Procedure BitBtn1Click (Sender: TObject); For i:=1 to stringgrid1. RowCount-1 do. Procedure… Π§ΠΈΡ‚Π°Ρ‚ΡŒ Π΅Ρ‰Ρ‘ >

Π˜Π·ΡƒΡ‡Π΅Π½ΠΈΠ΅ Ρ€Π°Π±ΠΎΡ‚Ρ‹ с Ρ„Π°ΠΉΠ»Π°ΠΌΠΈ Π½Π° языкС Delphi (Ρ€Π΅Ρ„Π΅Ρ€Π°Ρ‚, курсовая, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½Ρ‚Ρ€ΠΎΠ»ΡŒΠ½Π°Ρ)

ΠœΠΈΠ½ΠΈΡΡ‚Π΅Ρ€ΡΡ‚Π²ΠΎ образования ΠΈ Π½Π°ΡƒΠΊΠΈ Российской Π€Π΅Π΄Π΅Ρ€Π°Ρ†ΠΈΠΈ ΠšΡƒΡ€ΡΠΊΠΈΠΉ государствСнный тСхничСский унивСрситСт ΠšΠ°Ρ„Π΅Π΄Ρ€Π° ПО Π’Π’

Π˜Π·ΡƒΡ‡Π΅Π½ΠΈΠ΅ Ρ€Π°Π±ΠΎΡ‚Ρ‹ с Ρ„Π°ΠΉΠ»Π°ΠΌΠΈ Π½Π° ΡΠ·Ρ‹ΠΊΠ΅ Delphi

Π’Ρ‹ΠΏΠΎΠ»Π½ΠΈΠ»: студСнт Π³Ρ€. ПО 62 Шиляков И.А.

ΠŸΡ€ΠΎΠ²Π΅Ρ€ΠΈΠ»: ст. ΠΏΡ€Π΅ΠΏΠΎΠ΄Π°Π²Π°Ρ‚Π΅Π»ΡŒ ΠŸΠ΅Ρ‚Ρ€ΠΈΠΊ Π•.А.

ΠšΡƒΡ€ΡΠΊ

ЦСль:

Π˜Π·ΡƒΡ‡Π΅Π½ΠΈΠ΅ ΠΏΡ€ΠΈΠ½Ρ†ΠΈΠΏΠΎΠ² Ρ€Π°Π±ΠΎΡ‚Ρ‹ с Ρ„Π°ΠΉΠ»Π°ΠΌΠΈ Π½Π° ΡΠ·Ρ‹ΠΊΠ΅ Delphi, ΠΏΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ Π½Π°Π²Ρ‹ΠΊΠΎΠ² программирования с ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ΠΌ Ρ„Π°ΠΉΠ»ΠΎΠ².

Π—Π°Π΄Π°Π½ΠΈΠ΅:

Π‘ΠΎΠ·Π΄Π°Ρ‚ΡŒ ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³ ΠΏΡ€ΠΎΠ΄ΡƒΠΊΡ‚ΠΎΠ².

Окно ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹:

Π˜ΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅ΠΌΡ‹Π΅ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚Ρ‹:

β„–

Имя ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚Π°

Π‘Ρ‚Ρ€Π°Π½ΠΈΡ†Π° ΠΏΠ°Π»ΠΈΡ‚Ρ€Ρ‹ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚ΠΎΠ²

НастраиваСмыС ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚Ρ‹

ЗначСния

Form1

;

Π‘aption

Лабораторная Ρ€Π°Π±ΠΎΡ‚Π° № 10

Color

clMoneyGreen

Bitbtn1

Additional

Caption

Π£Π΄Π°Π»ΠΈΡ‚ΡŒ ΠΏΠΎ Π½Π°ΠΈΠΌΠ΅Π½ΠΎΠ²Π°Π½ΠΈΡŽ

Label1

Standard

Caption

Π’Π²Π΅Π΄ΠΈΡ‚Π΅ ΠΏΡ€ΠΎΠ΄ΡƒΠΊΡ‚Ρ‹ ΠΈ ΠΈΡ… ΡΡ‚ΠΎΠΈΠΌΠΎΡΡ‚ΡŒ

Color

clMoneyGreen

Color (Font)

clNavy

Size (Font)

Charset (Font)

DEFAULT_CHARSET

Height (Font)

— 16

ΠŸΡ€ΠΎΠ΄ΠΎΠ»ΠΆΠ΅Π½ΠΈΠ΅ Ρ‚Π°Π±Π»ΠΈΡ†Ρ‹

Label2

Standard

Caption

ΠžΠ±Ρ‰Π°Ρ сумма

Color

clMoneyGreen

Color (Font)

clNavy

Size (Font)

Charset (Font)

DEFAULT_CHARSET

Height (Font)

— 13

Button1

Standard

Caption

ΠžΡ‚ΠΊΡ€Ρ‹Ρ‚ΡŒ

Charset

BALTIC_CHARSET

Height

— 11

Size

Button2

Standard

Caption

Π‘ΠΎΡ…Ρ€Π°Π½ΠΈΡ‚ΡŒ

Charset

BALTIC_CHARSET

Height

— 11

Size

Button3

Standard

Caption

РасчСт

Charset

DEFAULT_CHARSET

Height

— 11

Size

Name

MS Sans Serif

Button4

Standard

Caption

Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ строку

Charset

DEFAULT_CHARSET

Height

— 11

Size

Name

MS Sans Serif

Button5

Standard

Caption

Поиск

Charset

DEFAULT_CHARSET

Height

— 11

Size

Name

MS Sans Serif

Edit1

Standard

Text

tt.text

Edit2

Standard

Text

Edit3

Standard

Text

Edit4

Standard

Text

StringGrid1

Additional

FixesCols

FixesRows

RowCount

ColCount

Options

[goEditing, goTab]

FixedColor

clSkyBlue

ВСкст ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹:

unit Unit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Grids, Buttons;

type

s30=string[30];

P = record

tovar: string[30];

money: integer;

kol: integer;

itogo: integer;

end;

TForm1 = class (TForm)

StringGrid1: TStringGrid;

Button1: TButton;

Button2: TButton;

Edit1: TEdit;

Label1: TLabel;

Button3: TButton;

Edit2: TEdit;

Label2: TLabel;

BitBtn1: TBitBtn;

Edit3: TEdit;

Button4: TButton;

Button5: TButton;

Edit4: TEdit;

procedure Button2Click (Sender: TObject);

procedure Button1Click (Sender: TObject);

procedure FormCreate (Sender: TObject);

procedure Button3Click (Sender: TObject);

procedure BitBtn1Click (Sender: TObject);

procedure Button4Click (Sender: TObject);

procedure Button5Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

{$R *.dfm}

function poisk (istochnik, chto: s30):boolean;

var i, k: integer;

procedure poisk2(B, M: s30);

var k: integer; b1: boolean;

begin

i:=0;

while length (b)>=length (m)+i do

begin

b1:=true;

for k:=1 to length (m) do begin

if m[k]=b[k+i] then else b1:=false;

end;

if b1=true then begin poisk:=b1; exit; end; i:=i+1;

end;

end;

begin

if length (istochnik)>=length (chto) then

poisk2(istochnik, chto)

else

poisk2(chto, istochnik);

end;

procedure TForm1. Button2Click (Sender: TObject);

var i: integer; s: string; z: p;

f: file of p;

begin

s:=edit1.Text;

system.Assign (f, s); // iacia? aaony eiy oaeeiaie ia? aiaiiie

rewrite (f); // niaaiea ionoiai oaeea, oeacaoaeu onoai. ia ioeaaie ye-o

for i:=1 to stringgrid1. RowCount do if (stringgrid1.Cells[0,i]<>'') then

begin

z.tovar:=stringgrid1.cells[0,i];

z.money:=strtoint (stringgrid1.cells[1,i]);

z.kol:=strtoint (stringgrid1.cells[2,i]);

write (f, z); // caienu a oaee f caiene z

end;

system.close (f);

end;

procedure TForm1. Button1Click (Sender: TObject);

var i: integer; z: p;

f: file of p;

begin

i:=1;

system.Assign (f, edit1. Text);

reset (f); // ioe? uou oaee

while not eof (f) do

begin

read (f, z);

stringgrid1.cells[0,i]: =z.tovar;

stringgrid1.cells[1,i]:=inttostr (z.money);

stringgrid1.cells[2,i]:=inttostr (z.kol);

stringgrid1.RowCount:=i+1;

i:=i+1;

end;

system.close (f);

end;

procedure TForm1. FormCreate (Sender: TObject);

begin

stringgrid1.Cells[0,0]: ='Oiaa?';

stringgrid1.Cells[1,0]:='Noieiinu';

stringgrid1.Cells[2,0]:='Eie-ai';

stringgrid1.Cells[3,0]:='Eoiai';

end;

procedure TForm1. Button3Click (Sender: TObject);

Var i: integer;

begin

edit2.Text:='0';

for i:=1 to stringgrid1. RowCount-1 do

begin

stringgrid1.cells[3,i]: =Floattostr (strtoint (stringgrid1.Cells[1,i])*(strtoint (stringgrid1.Cells[2,i])));

edit2.Text:=floattostr (strtofloat (stringgrid1.cells[3,i])+strtofloat (edit2.text));

end;

end;

procedure TForm1. BitBtn1Click (Sender: TObject);

var i, k: integer;

begin

i:=1;

repeat

if stringgrid1. Cells[0,i]=edit3.text then

begin

k:=i;

while k

begin

stringgrid1.Cells[0,k]: =stringgrid1.Cells[0,k+1];

stringgrid1.Cells[1,k]:=stringgrid1.Cells[1,k+1];

stringgrid1.Cells[2,k]:=stringgrid1.Cells[2,k+1];

stringgrid1.Cells[3,k]:=stringgrid1.Cells[3,k+1];

k:=k+1;

end;

stringgrid1.RowCount:=stringgrid1.RowCount-1;

end;

i:=i+1;

until stringgrid1. RowCount-1

end;

procedure TForm1. Button4Click (Sender: TObject);

var i: integer;

begin

stringgrid1.RowCount:=stringgrid1.RowCount+1;

for i:=0 to 4 do

stringgrid1.cells[i, stringgrid1. RowCount-1]: ='';

end;

procedure TForm1. Button5Click (Sender: TObject);

var i: integer; z: p;

f: file of p;

begin

system.Assign (f, edit1. Text);

reset (f); // ioe? uou oaee

stringgrid1.RowCount:=2;

stringgrid1.Cells[0,1]: ='Ia iaeaaii';

for i:=1 to 3 do

stringgrid1.Cells[i, 1]: ='';

i:=1;

while (not eof (f)) and (edit4.text<>'') do

begin

read (f, z);

if poisk (AnsiUpperCase (z.tovar), AnsiUpperCase (edit4.text)) then

begin

stringgrid1.cells[0,i]: =z.tovar;

stringgrid1.cells[1,i]:=inttostr (z.money);

stringgrid1.cells[2,i]:=inttostr (z.kol);

stringgrid1.RowCount:=i+1;

i:=i+1;

end;

end;

system.close (f);

end;

end.

ВСстированиС:

ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ вСсь тСкст
Π—Π°ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ Ρ„ΠΎΡ€ΠΌΡƒ Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ Ρ€Π°Π±ΠΎΡ‚ΠΎΠΉ