linkedin facebook linkedin facebook nod32

Delphida kalkulyatorni yaratish dasturi

Muallif: Mengliyev Sh.

Qo`shilgan sana: 2014-10-27

Delphida kalkulyatorni yaratish dasturi

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;

type
TForm1 = class(TForm)
Panel1: TPanel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button6: TButton;
Button5: TButton;
Button11: TButton;
Button10: TButton;
Button9: TButton;
Button8: TButton;
Button7: TButton;
Button16: TButton;
Button15: TButton;
Button17: TButton;
Button20: TButton;
Button21: TButton;
Button22: TButton;
Button19: TButton;
Button18: TButton;
Button14: TButton;
Button13: TButton;
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Button11Click(Sender: TObject);
procedure Button16Click(Sender: TObject);
procedure Button15Click(Sender: TObject);
procedure Button17Click(Sender: TObject);
procedure Button20Click(Sender: TObject);
procedure Button21Click(Sender: TObject);
procedure Button14Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button22Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure Button18Click(Sender: TObject);
procedure Button19Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

//o'zaruvchilarni elon qilish

var
Form1: TForm1;
a,b,s:integer;
t:string;
implementation

{$R *.dfm}

//Formada rangni aktivlashtrish

procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Font.Color:=clWhite;
//Edit1.Enabled:=false;
t:='j';
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
//Edit1.Enabled:=true;
Edit1.Text:='';// text bo'sh bo'lish
Edit1.Font.Color:=clRed;
end;

//8 ta bir raqamini aktivlashish
procedure TForm1.Button7Click(Sender: TObject);
begin
if t='' then
else
begin
if length(Edit1.Text)<8 then Edit1.Text:=Edit1.Text+'1';
end;
b:=strtoint(edit1.Text);
end;

procedure TForm1.Button8Click(Sender: TObject);
begin
if t='' then
else
begin
if length(Edit1.Text)<8 then Edit1.Text:=Edit1.Text+'2';
end;
b:=strtoint(edit1.Text);
end;

procedure TForm1.Button9Click(Sender: TObject);
begin
if t='' then
else
begin
if length(Edit1.Text)<8 then Edit1.Text:=Edit1.Text+'3';
end;
b:=strtoint(edit1.Text);
end;

procedure TForm1.Button10Click(Sender: TObject);
begin
if t='' then
else
begin
if length(Edit1.Text)<8 then Edit1.Text:=Edit1.Text+'4';
end;
b:=strtoint(edit1.Text);
end;

procedure TForm1.Button11Click(Sender: TObject);
begin
if t='' then
else
begin
if length(Edit1.Text)<8 then Edit1.Text:=Edit1.Text+'5';
end;
b:=strtoint(edit1.Text);
end;

procedure TForm1.Button16Click(Sender: TObject);
begin
if t='' then
else
begin
if length(Edit1.Text)<8 then Edit1.Text:=Edit1.Text+'6';
end;
b:=strtoint(edit1.Text);
end;

procedure TForm1.Button15Click(Sender: TObject);
begin
if t='' then
else
begin
if length(Edit1.Text)<8 then Edit1.Text:=Edit1.Text+'7';
end;
b:=strtoint(edit1.Text);
end;

procedure TForm1.Button17Click(Sender: TObject);
begin
if t='' then
else
begin
if length(Edit1.Text)<8 then Edit1.Text:=Edit1.Text+'8';
end;
b:=strtoint(edit1.Text);
end;

procedure TForm1.Button20Click(Sender: TObject);
begin
if t='' then
else
begin
if length(Edit1.Text)<8 then Edit1.Text:=Edit1.Text+'9';
end;
b:=strtoint(edit1.Text);
end;

procedure TForm1.Button21Click(Sender: TObject);
begin
if t='' then
else
begin
if length(Edit1.Text)<8 then Edit1.Text:=Edit1.Text+'0';
end;
b:=strtoint(edit1.Text);
end;

procedure TForm1.Button14Click(Sender: TObject);
begin
a:=StrToInt(Edit1.text);
t:='+';
edit1.text:='';
end;

// 4-ta amlning bajarilish

procedure TForm1.Button22Click(Sender: TObject);
begin
if t='+' then
edit1.Text:=inttostr(a+b);
if t='-' then
edit1.Text:=inttostr(a-b);
if t='*' then
edit1.Text:=inttostr(a*b);
if t='/' then
edit1.Text:=floattostr(a/b)
else exit;
end;

 

procedure TForm1.Button13Click(Sender: TObject);
begin
a:=StrToInt(Edit1.text);
t:='*';
edit1.text:='';
end;

procedure TForm1.Button18Click(Sender: TObject);
begin
a:=StrToInt(Edit1.text);
t:='-';
edit1.text:='';
end;

procedure TForm1.Button19Click(Sender: TObject);
begin
a:=StrToInt(Edit1.text);
t:='/';
edit1.text:='';
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
edit1.Text:='';
Edit1.Font.Color:=clWhite;
//edit1.Enabled:=false;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Edit1.Text:=FloatToStr(a*b/100);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text:=FloatToStr(sqrt(StrToInt(Edit1.text)));
end;

end.

2222 marta o`qildi.

Parol:
Eslab qolish.


Ro`yhatdan o`tish

testing

+998915878681

Siz o`z maxsulotingizni 3D reklama ko`rinishda bo`lishini xohlaysizmi? Unda xamkorlik qilamiz.

3D Reklama


Рейтинг@Mail.ru
Рейтинг@Mail.ru

Besucherzahler
счетчик посещений