1-topshiriq to’g’ri burchakli uchburchakning a va


N natural son ListBoxda bo’lsin. Shu sonlarning 13% hisoblab, keyingi ListBoxga yozing


Download 48.25 Kb.
bet7/17
Sana23.11.2023
Hajmi48.25 Kb.
#1795130
1   2   3   4   5   6   7   8   9   10   ...   17
Bog'liq
1-topshiriq to’g’ri burchakli uchburchakning a va-fayllar.org

N natural son ListBoxda bo’lsin. Shu sonlarning 13% hisoblab, keyingi ListBoxga yozing

double n;


for (int i = 0; i < listBox1->Items->Count; i++) {
n = (Convert::ToDouble(listBox1->Items[i]) * 13) / 100;
listBox2->Items->Add(Convert::ToString(n));
}
}
private: System::Void Labaratoriya2_Load(System::Object^ sender, System::EventArgs^ e)
{
Random ^n = gcnew Random();
for (int i = 0; i < 25; i++)
{
listBox1->Items->Add(Convert::ToString(n->Next(10,100)));
}
}
};
}

11. N ta birinchi tub sonning qiymati ListBoxga yozing
12. Bitta ListBoxda quyidagicha elementlar bo’lsin:
Misol: 1 2 3 4 5
Natija sifatida ikkinchi listboxga uni ikki martadan yozing:
Natija: 1 1 2 2 3 3 4 4 5 5
13. N ta xodimning maoshlari qiymati ma’lum (ListBoxda). Z summadan katta maosh oluvchi xodimlarnining maoshlari hammasi Z ga almashtirilsin. (Yangi ListBoxda)
14. N ta xodimning maoshlari qiymati ma’lum (ListBoxda). Eng katta maosh oluvchi
xodimning maoshi eng kam maosh oluvchi xodimning maoshidan necha barobar katta
ekanligini aniqlang. Natija Label da chip etilsin.


  1. ListBoxda mahsulot narxlari yozilgan. Bu mahsulotlarga 15% chegirma e’lon qilingangan keyingi yangi narxlar yangi ListBoxda chop etilsin.

int chegirma = Convert::ToInt32(numericUpDown1->Text);


listBox2->Items->Clear();
if (chegirma > 0) {
for (size_t i = 0; i < listBox1->Items->Count; i++)
{
double n = Convert::ToDouble(listBox1->Items[i]);
listBox2->Items->Add(n-((chegirma*n)/100));
}
}
}
private: System::Void Task2_Load(System::Object^ sender, System::EventArgs^ e) {
listBox1->Items->Clear();
Random ^rand = gcnew Random();
for (size_t i = 0; i < 20; i++)
{
listBox1->Items->Add(Convert::ToInt32(rand->Next(1, 1000)));
}



  1. Download 48.25 Kb.

    Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   10   ...   17




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