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

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, ExtCtrls, XPMan, Grids, TabNotBk;

type
TForm2 = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
XPManifest1: TXPManifest;
GroupBox3: TGroupBox;
GroupBox2: TGroupBox;
RadioButton10: TRadioButton;
RadioButton11: TRadioButton;
RadioButton12: TRadioButton;
RadioButton13: TRadioButton;
RadioButton14: TRadioButton;
RadioButton15: TRadioButton;
RadioButton16: TRadioButton;
RadioButton17: TRadioButton;
RadioButton18: TRadioButton;
Label27: TLabel;
Label28: TLabel;
Label29: TLabel;
Edit57: TEdit;
Edit58: TEdit;
Label30: TLabel;
Edit59: TEdit;
GroupBox1: TGroupBox;
Label31: TLabel;
Edit15: TEdit;
Label32: TLabel;
Edit16: TEdit;
Button13: TButton;
Button14: TButton;
Button15: TButton;
Button16: TButton;
Button38: TButton;
Label33: TLabel;
Edit17: TEdit;
TabSheet3: TTabSheet;
GroupBox4: TGroupBox;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label34: TLabel;
GroupBox5: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
RadioButton5: TRadioButton;
RadioButton6: TRadioButton;
RadioButton7: TRadioButton;
Edit8: TEdit;
Edit9: TEdit;
Edit10: TEdit;
GroupBox6: TGroupBox;
Label21: TLabel;
Label22: TLabel;
Label35: TLabel;
Edit11: TEdit;
Edit12: TEdit;
Button2: TButton;
Button8: TButton;
Button9: TButton;
Button10: TButton;
Button11: TButton;
Button12: TButton;
Edit13: TEdit;
GroupBox11: TGroupBox;
Label40: TLabel;
Button49: TButton;
Button50: TButton;
Button51: TButton;
Button52: TButton;
Button53: TButton;
Button54: TButton;
Button55: TButton;
Edit18: TEdit;
GroupBox7: TGroupBox;
Label13: TLabel;
Label14: TLabel;
Label36: TLabel;
Label37: TLabel;
Edit14: TEdit;
Edit19: TEdit;
Edit20: TEdit;
GroupBox8: TGroupBox;
RadioButton8: TRadioButton;
RadioButton9: TRadioButton;
RadioButton19: TRadioButton;
RadioButton20: TRadioButton;
GroupBox9: TGroupBox;
Label25: TLabel;
Label26: TLabel;
Edit21: TEdit;
Edit22: TEdit;
StringGrid1: TStringGrid;
Button17: TButton;
GroupBox10: TGroupBox;
Edit23: TEdit;
Edit24: TEdit;
Label38: TLabel;
Label41: TLabel;
StringGrid2: TStringGrid;
Button18: TButton;
Label39: TLabel;
Edit44: TEdit;
TabSheet4: TTabSheet;
GroupBox17: TGroupBox;
Label15: TLabel;
GroupBox18: TGroupBox;
Label9: TLabel;
Edit45: TEdit;
Edit46: TEdit;
Edit47: TEdit;
Edit48: TEdit;
Label24: TLabel;
Edit49: TEdit;
Label47: TLabel;
Edit50: TEdit;
Button31: TButton;
Label48: TLabel;
ListBox2: TListBox;
TabSheet5: TTabSheet;
GroupBox12: TGroupBox;
Label42: TLabel;
Label43: TLabel;
Label44: TLabel;
Label45: TLabel;
GroupBox13: TGroupBox;
RadioButton21: TRadioButton;
RadioButton22: TRadioButton;
RadioButton23: TRadioButton;
Edit25: TEdit;
Edit26: TEdit;
Edit38: TEdit;
GroupBox14: TGroupBox;
Label46: TLabel;
GroupBox16: TGroupBox;
Button19: TButton;
Button20: TButton;
Button21: TButton;
Button22: TButton;
Edit39: TEdit;
Edit40: TEdit;
Edit41: TEdit;
Edit42: TEdit;
Edit43: TEdit;
Timer1: TTimer;
Label1: TLabel;
Button1: TButton;
Edit1: TEdit;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure MonthCalendar1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button14Click(Sender: TObject);
procedure Button15Click(Sender: TObject);
procedure Button16Click(Sender: TObject);
procedure Button27Click(Sender: TObject);
procedure Button38Click(Sender: TObject);
procedure Button43Click(Sender: TObject);
procedure Button44Click(Sender: TObject);
procedure RadioButton10Click(Sender: TObject);
procedure RadioButton11Click(Sender: TObject);
procedure RadioButton12Click(Sender: TObject);
procedure RadioButton18Click(Sender: TObject);
procedure RadioButton13Click(Sender: TObject);
procedure RadioButton14Click(Sender: TObject);
procedure RadioButton15Click(Sender: TObject);
procedure RadioButton16Click(Sender: TObject);
procedure RadioButton17Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
procedure RadioButton4Click(Sender: TObject);
procedure RadioButton5Click(Sender: TObject);
procedure RadioButton6Click(Sender: TObject);
procedure RadioButton7Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Button11Click(Sender: TObject);
procedure Button12Click(Sender: TObject);
procedure RadioButton9Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button17Click(Sender: TObject);
procedure Button18Click(Sender: TObject);
procedure RadioButton21Click(Sender: TObject);
procedure RadioButton22Click(Sender: TObject);
procedure RadioButton23Click(Sender: TObject);
procedure Button19Click(Sender: TObject);
procedure Button49Click(Sender: TObject);
procedure Button50Click(Sender: TObject);
procedure Button51Click(Sender: TObject);
procedure Button52Click(Sender: TObject);
procedure Button53Click(Sender: TObject);
procedure Button54Click(Sender: TObject);
procedure Button55Click(Sender: TObject);
procedure Button31Click(Sender: TObject);
procedure Button20Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);



// procedure FormCreate(Sender: TObject);


// procedure TabSheet5ContextPopup(Sender: TObject; MousePos: TPoint;

private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;
Y6, M6, D6, Y5, M5, D5, Y, M, D ,Y2, M2,M3,y3, D2:Word;
Date5, DD2,Date,Date2,Date3: TdateTime;
DDD,W,S:real;
SSS, S1,S2,S3:real;
Ss1,Ss2,Ss3, i4,F,WEE2,WEE,i,i2,i3,ii1,ii2,ii3:integer;
Msec, Hour, Min, Sec:Word;
A1,A2:Integer;
k1:Integer;
TimerSpeeder : real;
p:tDateTime;
X1,X2:Single;
q,b,c,a:real;
W1,W2,Wn:string;
Sym:Integer;
R:real;
XX1,XX2:Real;
g:string;
VA:integer;//вычисление вещественных функций
FY:Real;
implementation

uses Unit1, Unit3;

{$R *.dfm}

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Form1.show;
end;

procedure TForm2.Button1Click(Sender: TObject);
var
Data:TDateTime;
begin
Form3.Show;
end;

procedure TForm2.Timer1Timer(Sender: TObject);
begin
label1.Caption:=TimeToStr(Time);
end;

procedure TForm2.Button7Click(Sender: TObject);
begin
TimerSpeeder:=0;


end;

procedure TForm2.Button8Click(Sender: TObject);
begin
XX1:=StrToFloat(Edit11.Text);
XX2:=StrToFloat(Edit12.Text);
Edit13.Text:=FloatToStr(XX1-XX2);
end;

procedure TForm2.Button3Click(Sender: TObject);
begin
Close;

end;

procedure TForm2.MonthCalendar1Click(Sender: TObject);
begin
//P:=MonthCalendar1.date;
//Edit7.text:=datetostr(P);
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
XX1:=StrToFloat(Edit11.Text);
XX2:=StrToFloat(Edit12.Text);
Edit13.Text:=FloatToStr(XX1+XX2);

end;

procedure TForm2.Button14Click(Sender: TObject);
var I:ShortInt;
begin
A1:=StrToInt(Edit15.Text);
A2:=StrToInt(Edit16.Text);
Edit17.Text:=IntToStr(A1-A2);

end;

procedure TForm2.Button15Click(Sender: TObject);
begin
A1:=StrToInt(Edit15.Text);
A2:=StrToInt(Edit16.Text);
Edit17.Text:=IntToStr(A1*A2);
end;

procedure TForm2.Button16Click(Sender: TObject);
begin
A1:=StrToInt(Edit15.Text);
A2:=StrToInt(Edit16.Text);
Edit17.Text:=IntToStr(A1 div A2);

end;

procedure TForm2.Button27Click(Sender: TObject);
var
Sn:String;
f:Integer;
Sn_Copy:String;
Sb:String;
r1,r2:Integer;
c:Char;
begin

end;

procedure TForm2.Button38Click(Sender: TObject);
begin
A1:=StrToInt(Edit15.Text);
A2:=StrToInt(Edit16.Text);
Edit17.Text:=IntToStr(A1 mod A2);
end;

procedure TForm2.Button43Click(Sender: TObject);
begin
Close;
end;

procedure TForm2.Button44Click(Sender: TObject);
begin
Close;
end;

procedure TForm2.RadioButton10Click(Sender: TObject);
begin
Edit57.Text:=Inttostr(Low(Integer));
Edit58.Text:=IntTostr(High(Integer));
Edit59.Text:=(IntToStr(SizeOf(Integer)));
end;

procedure TForm2.RadioButton11Click(Sender: TObject);
begin
Edit57.Text:=Inttostr(Low(Cardinal));
Edit58.Text:=IntTostr(High(Cardinal));
Edit59.Text:=(IntToStr(SizeOf(Cardinal)));
end;

procedure TForm2.RadioButton12Click(Sender: TObject);
begin
Edit57.Text:=Inttostr(Low(ShortInt));
Edit58.Text:=IntTostr(High(ShortInt));
Edit59.Text:=(IntToStr(SizeOf(ShortInt)));
end;

procedure TForm2.RadioButton18Click(Sender: TObject);
begin
Edit57.Text:=Inttostr(Low(SmallInt));
Edit58.Text:=IntTostr(High(SmallInt));
Edit59.Text:=(IntToStr(SizeOf(SmallInt)));
end;

procedure TForm2.RadioButton13Click(Sender: TObject);
begin
Edit57.Text:=Inttostr(Low(LongInt));
Edit58.Text:=IntTostr(High(LongInt));
Edit59.Text:=(IntToStr(SizeOf(LongInt)));
end;

procedure TForm2.RadioButton14Click(Sender: TObject);
begin
Edit57.Text:=Inttostr(Low(Int64));
Edit58.Text:=IntTostr(High(Int64));
Edit59.Text:=(IntToStr(SizeOf(Int64)));
end;

procedure TForm2.RadioButton15Click(Sender: TObject);
begin
Edit57.Text:=Inttostr(Low(Byte));
Edit58.Text:=IntTostr(High(Byte));
Edit59.Text:=(IntToStr(SizeOf(Byte)));
end;

procedure TForm2.RadioButton16Click(Sender: TObject);
begin
Edit57.Text:=Inttostr(Low(Word));
Edit58.Text:=IntTostr(High(Word));
Edit59.Text:=(IntToStr(SizeOf(Word)));
end;

procedure TForm2.RadioButton17Click(Sender: TObject);
begin
Edit57.Text:=Inttostr(Low(LongWord));
Edit58.Text:=IntTostr(High(LongWord));
Edit59.Text:=(IntToStr(SizeOf(LongWord)));
end;

procedure TForm2.Button13Click(Sender: TObject);
begin
A1:=StrToInt(Edit15.Text);
A2:=StrToInt(Edit16.Text);
Edit17.Text:=IntToStr(A1+A2);
end;

procedure TForm2.RadioButton1Click(Sender: TObject);
begin
Edit8.Text:='5,0E-324';
Edit9.Text:='1,7E308';
Edit10.Text:='6 байт';
end;

procedure TForm2.RadioButton3Click(Sender: TObject);
begin
//Edit14.Text:=Inttostr(Low(WordBool));
//Edit19.Text:=IntTostr(High(WordBool));
Edit20.Text:=(IntToStr(SizeOf(WordBool)));
Edit8.Text:='5,0E-324';
Edit9.Text:='1,7E308';
//Edit10.Text:='8 байт';

end;

procedure TForm2.RadioButton4Click(Sender: TObject);
begin
//Edit14.Text:=Inttostr(Low(LongBool));
//Edit19.Text:=IntTostr(High(LongBool));
Edit20.Text:=(IntToStr(SizeOf(LongBool)));
Edit8.Text:='3,6E-4951';
Edit9.Text:='1,1E4932';
Edit10.Text:='10 байт';
end;

procedure TForm2.RadioButton5Click(Sender: TObject);
begin
Edit10.Text:=(FloatToStr(SizeOf(Comp)));
Edit8.Text:='(-2 в ст.63)+1';
Edit9.Text:='(2 в ст.63)-1';
Edit10.Text:='8 байт';
end;

procedure TForm2.RadioButton6Click(Sender: TObject);
begin
Edit10.Text:=(FloatToStr(SizeOf(Currency)));
Edit8.Text:='-922337203685477,5808';
Edit9.Text:='922337203685477,5807';
Edit10.Text:='8 байт';
end;

procedure TForm2.RadioButton7Click(Sender: TObject);
begin
Edit10.Text:=(FloatToStr(SizeOf(Real48)));
Edit8.Text:='2,9E-39';
Edit9.Text:='1,7E38';
Edit10.Text:='6 байт';
end;

procedure TForm2.Button9Click(Sender: TObject);
begin
XX1:=StrToFloat(Edit11.Text);
XX2:=StrToFloat(Edit12.Text);
Edit13.Text:=FloatToStr(XX1*XX2);
end;

procedure TForm2.Button10Click(Sender: TObject);
begin
XX1:=StrToFloat(Edit11.Text);
XX2:=StrToFloat(Edit12.Text);
Edit13.Text:=FloatToStr(XX1/XX2);
end;

procedure TForm2.Button11Click(Sender: TObject);
begin
XX1:=StrToFloat(Edit11.Text);
XX2:=StrToFloat(Edit12.Text);
Edit13.Text:=FloatToStr(Int(XX1));
end;

procedure TForm2.Button12Click(Sender: TObject);
begin
XX1:=StrToFloat(Edit11.Text);
XX2:=StrToFloat(Edit12.Text);
Edit13.Text:=FloatToStr(frac(XX1));
end;

procedure TForm2.RadioButton9Click(Sender: TObject);
begin
Edit14.Text:=Booltostr(Low(ByteBool));
Edit19.Text:=BoolTostr(High(ByteBool));
Edit20.Text:=(IntToStr(SizeOf(ByteBool)));
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
StringGrid1.Cells[0,0]:='Операция';
StringGrid1.Cells[1,0]:='Рез-т';
TabSheet4.Width:=400;
end;

procedure TForm2.Button17Click(Sender: TObject);
var
B1,B2:integer;
begin
B1:=StrtoInt(Edit21.Text);
B2:=StrToInt(Edit22.Text);
//-------------------------------------------
StringGrid1.Cells[0,1]:='B1=B2';
if (B1=B2) then StringGrid1.Cells[1,1]:='true'
else StringGrid1.Cells[1,1]:='false';
StringGrid1.Cells[0,2]:='B1<B2';
if (B1<B2) then StringGrid1.Cells[1,2]:='true'
else StringGrid1.Cells[1,2]:='false';
StringGrid1.Cells[0,3]:='B1>B2';
if (B1>B2) then StringGrid1.Cells[1,3]:='true'
else StringGrid1.Cells[1,3]:='false';
StringGrid1.Cells[0,4]:='B1<=B2';
if (B1<=B2) then StringGrid1.Cells[1,4]:='true'
else StringGrid1.Cells[1,4]:='false';
StringGrid1.Cells[0,5]:='B1>=B2';
if (B1>=B2) then StringGrid1.Cells[1,5]:='true'
else StringGrid1.Cells[1,5]:='false';
StringGrid1.Cells[0,6]:='B1<>B2';
if (B1<>B2) then StringGrid1.Cells[1,6]:='true'
else StringGrid1.Cells[1,6]:='false';
end;

procedure TForm2.Button18Click(Sender: TObject);
var
A,B:Boolean;
begin
A:=StrtoBool(Edit23.Text);
B:=StrToBool(Edit24.Text);
StringGrid2.Cells[0,0]:='Oперация';
StringGrid2.Cells[1,0]:='Результат';
//----------------------------------
StringGrid2.Cells[0,1]:='not A';

if ((not A)=false) then StringGrid2.Cells[1,1]:='false'
else StringGrid2.Cells[1,1]:='true';

StringGrid2.Cells[0,2]:='A and B';
if ((A and B)=true) then StringGrid2.Cells[1,2]:='true'
else StringGrid2.Cells[1,2]:='false';

StringGrid2.Cells[0,3]:='A or B';
if ((A or B)=true) then StringGrid2.Cells[1,3]:='true'
else StringGrid2.Cells[1,3]:='false';

StringGrid2.Cells[0,4]:='A xor B';
if ((A xor B)=true) then StringGrid2.Cells[1,4]:='true'
else StringGrid2.Cells[1,4]:='false';
end;

procedure TForm2.RadioButton21Click(Sender: TObject);
begin
if (Low(Char)=#0) then Edit25.Text:='probel' else Edit25.Text:=Low(Char);
Edit26.Text:=High(Char);
Edit38.Text:=(IntToStr(SizeOf(Char)));
end;

procedure TForm2.RadioButton22Click(Sender: TObject);
begin
if (Low(AnsiChar)=#0) then Edit25.Text:='probel' else Edit25.Text:=Low(AnsiChar);
Edit26.Text:=High(AnsiChar);
Edit38.Text:=(IntToStr(SizeOf(AnsiChar)));
end;

procedure TForm2.RadioButton23Click(Sender: TObject);
begin
if (Low(WideChar)=#0) then Edit25.Text:='probel' else Edit25.Text:=Low(WideChar);
Edit26.Text:=High(WideChar);
Edit38.Text:=(IntToStr(SizeOf(WideChar)));
end;

procedure TForm2.Button19Click(Sender: TObject);
begin
g:=Edit43.Text;
Edit39.Text:=UpperCase(g);

end;

procedure TForm2.Button49Click(Sender: TObject);
begin
VA:=StrToInt(Edit44.Text);
Fy:=Sin(VA);
Edit18.Text:=FormatFloat('0.000',FY);
end;

procedure TForm2.Button50Click(Sender: TObject);
begin
VA:=StrToInt(Edit44.Text);
Fy:=cos(VA);
Edit18.Text:=FormatFloat('0.000',FY);
end;

procedure TForm2.Button51Click(Sender: TObject);
begin
VA:=StrToInt(Edit44.Text);
Fy:=Sin(VA)/Cos(VA);
Edit18.Text:=FormatFloat('0.000',FY);
end;

procedure TForm2.Button52Click(Sender: TObject);
begin
VA:=StrToInt(Edit44.Text);
Fy:=Cos(VA)/Sin(VA);
Edit18.Text:=FormatFloat('0.000',FY);
end;

procedure TForm2.Button53Click(Sender: TObject);
begin
VA:=StrToInt(Edit44.Text);
Fy:=Ln(VA);
Edit18.Text:=FormatFloat('0.000',FY);
end;

procedure TForm2.Button54Click(Sender: TObject);
begin
VA:=StrToInt(Edit44.Text);
Fy:=Exp(VA);
Edit18.Text:=FormatFloat('0.000',FY);
end;

procedure TForm2.Button55Click(Sender: TObject);
begin
VA:=StrToInt(Edit44.Text);
Fy:=Sqrt(VA);
Edit18.Text:=FormatFloat('0.000',FY);
end;

procedure TForm2.Button31Click(Sender: TObject);
begin
ListBox2.Items.Text:='';
Y:=StrToInt(Edit47.text);
M:=StrToInt(Edit46.text);
D:=StrToInt(Edit45.text);
Date:=EncodeDate(Y,M,D);
S:= Now - Date;
Edit48.text:=FloatToStr(int(S));
W:=Date+10000;
Edit50.text:=DateToStr(w);

WEE:=DayOfWeek(Date);
if WEE=1 then Edit49.Text:='Воскрксенье';
if WEE=2 then Edit49.Text:='Понедельник';
if WEE=3 then Edit49.Text:='Вторник';
if WEE=4 then Edit49.Text:='Среда';
if WEE=5 then Edit49.Text:='Чтверг';
if WEE=6 then Edit49.Text:='Пятница';
if WEE=7 then Edit49.Text:='Суббота';



for i4:=y to 2100 do
begin
Date:=EncodeDate(Y,M,D);
WEE:=DayOfWeek(Date);
if WEE=1 then ListBox2.Items.Text:=ListBox2.Items.Text+DateToStr(Date);
Y:=Y+1;
end;
end;

procedure TForm2.Button20Click(Sender: TObject);
var
g:String;
i,j,k:integer;
begin
g:=Edit43.text;
Edit40.Text:=IntToStr(Ord(g[1]));
i:=ord(g[1]);
j:=i-1;
k:=i+1;
Edit41.Text:=(chr(j));
Edit42.Text:=(chr(k));
end;

procedure TForm2.RadioButton2Click(Sender: TObject);
begin
Edit8.Text:='1,5E-45';
Edit9.Text:='3,4E38';
Edit10.Text:='4 байт';
end;

end.
Соседние файлы в папке Данные
  • #
    26.04.20152.21 Кб1Unit1.dfm
  • #
    26.04.20151.44 Кб0Unit1.pas
  • #
    26.04.201531.94 Кб0Unit2.dcu
  • #
    26.04.201551 б0Unit2.ddp
  • #
    26.04.201540.13 Кб0Unit2.dfm
  • #
    26.04.201518.05 Кб0Unit2.pas
  • #
    26.04.20154.77 Кб1Unit3.dcu
  • #
    26.04.201551 б0Unit3.ddp
  • #
    26.04.2015588 б0Unit3.dfm
  • #
    26.04.2015927 б0Unit3.pas
  • #
    26.04.20158.96 Кб0Unit4.dcu