Калькулятор курилмасини Delphi дастурлаш тилида яратиш


 9. Калькулятор курилмасининг тулик куриниши



Download 308,77 Kb.
Pdf ko'rish
bet3/5
Sana21.02.2022
Hajmi308,77 Kb.
#50829
1   2   3   4   5
Bog'liq
2 5258134585669059144

2. 9. Калькулятор курилмасининг тулик куриниши
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;
var
Form1: TForm1;
a,b,s:integer;
t:string;
implementation
{$R *.dfm}
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:='';
Edit1.Font.Color:=clRed;
end;
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;
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.

Download 308,77 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5




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

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish