Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
1234.docx
Скачиваний:
0
Добавлен:
01.05.2025
Размер:
21.21 Кб
Скачать

1лаба

unit Unit1;

interface

uses

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

Dialogs, StdCtrls,DateUtils, Mask;

type

TForm1 = class(TForm)

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Button1: TButton;

MaskEdit1: TMaskEdit;

MaskEdit2: TMaskEdit;

Button2: TButton;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

var n:integer;

begin

n:=DaysBetween(now,strtodatetime(maskedit1.text));

label3.Caption:='Осталось дней до дня рожденья- '+inttostr(n);

n:=DaysBetween(now,strtodatetime(maskedit2.text));

label4.Caption:='Осталось дней до нового года- '+inttostr(n);

end;

procedure TForm1.Button2Click(Sender: TObject);

begin

Form1.Close;

end;

end.

1.1Лаба

unit Unit2;

Interface

uses

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

Dialogs, StdCtrls;

type

TForm1 = class(TForm)

Edit1: TEdit;

Edit2: TEdit;

Button1: TButton;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Button2: TButton;

Label5: TLabel;

Button3: TButton;

procedure Button2Click(Sender: TObject);

procedure Button1Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;a,x,b,r,s:real;

Implementation

{$R *.dfm}

procedure TForm1.Button2Click(Sender: TObject);

begin

a:=strtofloat(edit1.text);

b:=strtofloat(edit2.text);

label3.caption:=('Значения a='+edit1.Text+', b='+edit2.Text+', x='+floattostr(x));

r:=(sqr(x)*(x+1)/b)-sqr(sin(x+a));

s:=(x*b/a)+cos(Sqr(x+b));

label4.Caption:=('r= '+floattostr(r));

label5.caption:=('s= '+floattostr(s));

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

x:=strtofloat(inputBox('Остальные аргументы','Введите x=',''));

end;

procedure TForm1.Button3Click(Sender: TObject);

begin

Form1.Close;

end;

end.

2лаба

unit Unit1;

Interface

uses

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

Dialogs, StdCtrls;

type

TForm1 = class(TForm)

GroupBox1: TGroupBox;

GroupBox2: TGroupBox;

GroupBox3: TGroupBox;

CheckBox1: TCheckBox;

CheckBox2: TCheckBox;

CheckBox3: TCheckBox;

CheckBox4: TCheckBox;

Label1: TLabel;

Button1: TButton;

Label2: TLabel;

Label3: TLabel;

Button2: TButton;

Label4: TLabel;

RadioButton1: TRadioButton;

RadioButton2: TRadioButton;

RadioButton3: TRadioButton;

RadioButton4: TRadioButton;

Label6: TLabel;

Button3: TButton;

Label7: TLabel;

RadioButton5: TRadioButton;

RadioButton6: TRadioButton;

RadioButton7: TRadioButton;

RadioButton8: TRadioButton;

Button4: TButton;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

procedure Button4Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

Implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

begin

if (checkbox2.checked=true)and(checkbox4.checked=true)

and(checkbox1.checked=false)and(checkbox3.checked=false)

then

label2.Caption:='Верно!' else label2.Caption:='Неверно!';

end;

procedure TForm1.Button2Click(Sender: TObject);

begin

if RadioButton2.checked=true then

Label3.caption:='Верно!' else

Label3.caption:='Неверно!';

end;

procedure TForm1.Button3Click(Sender: TObject);

begin

if RadioButton8.checked=true then

Label7.caption:='Верно!' else

Label7.caption:='Неверно!';

end;

procedure TForm1.Button4Click(Sender: TObject);

begin

Form1.Close;

end;

end.

3лаба

unit Unit1;

Interface

uses

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

Dialogs, StdCtrls,math;

type

TForm1 = class(TForm)

Label1: TLabel;

Label2: TLabel;

Edit1: TEdit;

Edit2: TEdit;

Label3: TLabel;

Edit3: TEdit;

Button1: TButton;

Label4: TLabel;

Memo1: TMemo;

Button2: TButton;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;n,s,r,k,a,b:integer;

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]