3-labaratoriya ishi. Bajardi: Mamasaidov m qabul qildi: Xoshimov b mavzu: Standart komponentalar palitrasi. Bir va bir nechta formalar bilan ishlash. Ishdan maqsad



Download 59,38 Kb.
bet2/2
Sana31.12.2021
Hajmi59,38 Kb.
#228215
1   2
Bog'liq
2 5273922524671905411

Amaliy qism

Amaliy qismda 5 ta sonni qo’shish, ayirish va 3 ta sonni bo’lish,ko’paytirish dasturini tuzish.





Bosh oyna kodi:

//---------------------------------------------------------------------------

#include

#pragma hdrstop

#include "Unit2.h"

#include "Unit1.h"

#include "Unit3.h"

#include "Unit4.h"

#include "Unit5.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm2 *Form2;

//---------------------------------------------------------------------------

__fastcall TForm2::TForm2(TComponent* Owner)

//---------------------------------------------------------------------------

__fastcall TForm1::TForm1(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------



void __fastcall TForm1::Button1Click(TObject *Sender)

{

Form2->ShowModal();



}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)

{

Form3->ShowModal();



}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button5Click(TObject *Sender)

{

Close();



}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button4Click(TObject *Sender)

{

Form5->ShowModal();



}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button3Click(TObject *Sender)

{

Form4->ShowModal();



}

//---------------------------------------------------------------------------

Qo’shish kodi:


/---------------------------------------------------------------------------

#include

#pragma hdrstop

#include "Unit1.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm1 *Form1;

int a, b, c, d, f, g;

//---------------------------------------------------------------------------

__fastcall TForm1::TForm1(TComponent* Owner)

: TForm(Owner)

{

}

//--------------------------------------------------------------------------



void __fastcall TForm1::Button2Click(TObject *Sender)

{

Close();



}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)

{

a=StrToInt(Edit1->Text);



b=StrToInt(Edit2->Text);

c=StrToInt(Edit3->Text);

d=StrToInt(Edit4->Text);

e=StrToInt(Edit5->Text);

g=a+b+c+d+f ;

Edit6->Text=IntToStr(g);

}

//---------------------------------------------------------------------------



void __fastcall TForm1::Button3Click(TObject *Sender)

{

Edit1->Text="";



Edit2->Text="";

Edit3->Text="";

Edit4->Text="";

Edit5->Text="";

Edit6->Text="";

}//---------------------------------------------------------------------------

Ayirish kodi:

//---------------------------------------------------------------------------

#include

#pragma hdrstop

#include "Unit3.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm3 *Form3;

int a, b, c, d, f, g;

//---------------------------------------------------------------------------

__fastcall TForm3::TForm3(TComponent* Owner)

: TForm(Owner)

{

}



//---------------------------------------------------------------------------

void __fastcall TForm3::Button1Click(TObject *Sender)

{

a=StrToInt(Edit1->Text);



b=StrToInt(Edit2->Text);

c=StrToInt(Edit3->Text);

d=StrToInt(Edit4->Text);

f=StrToInt(Edit5->Text);

g=a-b-c-d-f ;

Edit6->Text=IntToStr(g);

}

//---------------------------------------------------------------------------



void __fastcall TForm3::Button3Click(TObject *Sender)

{

Edit1->Text="";



Edit2->Text="";

Edit3->Text="";

Edit4->Text="";
Edit5->Text="";

Edit6->Text="";

}

//---------------------------------------------------------------------------



void __fastcall TForm3::Button2Click(TObject *Sender)

{

Close();



}

//---------------------------------------------------------------------------

Ko’paytirish kodi:

//---------------------------------------------------------------------------

#include

#pragma hdrstop

#include "Unit4.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm4 *Form4;

int a,b,c,d,f;

//---------------------------------------------------------------------------

__fastcall TForm4::TForm4(TComponent* Owner)

: TForm(Owner)

{

}



//---------------------------------------------------------------------------

void __fastcall TForm4::Button2Click(TObject *Sender)

{

Close();


}

//---------------------------------------------------------------------------

void __fastcall TForm4::Button1Click(TObject *Sender)

{

a=StrToInt(Edit1->Text);



b=StrToInt(Edit2->Text);

c=StrToInt(Edit3->Text);

f=StrToInt(Edit3->Text);

d=a*b*c*f;

Edit4->Text=IntToStr(d);

}

//---------------------------------------------------------------------------



void __fastcall TForm4::Button3Click(TObject *Sender)

{

Edit1->Text="";



Edit2->Text="";

Edit3->Text="";

Edit4->Text="";

}

//---------------------------------------------------------------------------



Bo’lish kodi:

//---------------------------------------------------------------------------

#include

#pragma hdrstop


#include "Unit4.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm4 *Form4;

int a,b,c,d,f;

//---------------------------------------------------------------------------

__fastcall TForm4::TForm4(TComponent* Owner)

: TForm(Owner)

{

}



//---------------------------------------------------------------------------

void __fastcall TForm4::Button2Click(TObject *Sender)

{

Close();


}

//---------------------------------------------------------------------------

void __fastcall TForm4::Button1Click(TObject *Sender)

{

a=StrToInt(Edit1->Text);



b=StrToInt(Edit2->Text);

c=StrToInt(Edit3->Text);

f=StrToInt(Edit3->Text);

d=a/b/c/f;

Edit4->Text=IntToStr(d);

}

//---------------------------------------------------------------------------



void __fastcall TForm4::Button3Click(TObject *Sender)

{

Edit1->Text="";



Edit2->Text="";

Edit3->Text="";

Edit4->Text="";

}

//--------------------------------------------------------------------------



Download 59,38 Kb.

Do'stlaringiz bilan baham:
1   2




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