4. Berilgan A va B sonlar modullarining o’rta geometrigini hisoblang
double a, b, c;
a = Convert::ToDouble(textBox1->Text);
b = Convert::ToDouble(textBox2->Text);
c = sqrt(fabs(a)*fabs(b));
label4->Text = "|A| = " + Convert::ToString(fabs(a));
label5->Text = "|B| = " + Convert::ToString(fabs(b));
label6->Text = "O'rta geometrik = " + Convert::ToString(c);
Parallelogrammning tomonlari A va B bo’lsa, uning bitta diagonali orqali
bo’linishidan hosil bo’lgan uchburchaklar yuzalarini toping. (2 ta Label, 2 ta TextBox, 1 ta Button. Natija Labelda chiqarilsin)
int b, r;
b = Convert::ToInt32(textBox1->Text);
r = Convert::ToInt32(textBox2->Text);
int s = b / (2 * r);
label6->Text = "Natija : Doiralar soni " + Convert::ToString(s*s) + " ta";
6. Teng tomonli uchburchakka ichki chizilgan doira yuzi S berilgan bo’lsa, uchburchak
medianasi va balandligini toping. (3 ta Label, 1 ta TextBox, 1 ta Button. Natija Labelda
chiqarilsin)
7. Noldan farqli a son va b son berilgan. ax+b=0 tenglamani yeching. ( 2 ta Label, 2 ta TextBox, 1 ta Button. Natija Labelda chiqarilsin)
8. Kompyuterning narxi A so’m edi. Unga bo’lgan talab oshgandan so’ng uning narxi B% ga ko’tarildi. Kompyuterning yangi bahosini Labelda chop eting
if (textBox1->Text->Length==0)
{
MessageBox::Show("Pleace. Enter the percentege to be encereased ", "Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
}
else
{
a = Convert::ToDouble(textBox1->Text)*Convert::ToDouble(label9->Text) / 100 + Convert::ToDouble(label9->Text);
label11->Text = "New price is " + a;
}
int b;
double a;
if (textBox1->Text->Length == 0)
{
MessageBox::Show("Pleace. Enter the percentege to be encereased ", "Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
}
else
{
for (int i = 0;i < listView1->Items->Count; i++) {
b = Convert::ToInt32(listView1->Items[i]->SubItems[6]->Text);
a = Convert::ToDouble(textBox1->Text)*Convert::ToDouble(b / 100 ) + b;
listView1->Items[i]->SubItems[6]->Text = "New price is " + a;
}}
Do'stlaringiz bilan baham: |