Guruh: 214-17 Axmadjanov Abrorjon 2-Amaliy ish. Mavzu. To’g’ri zanjir usuli. Ishdan maqsad
Download 0.55 Mb.
|
2-Amaliy Sun'iy intellekt
- Bu sahifa navigatsiya:
- Source.cpp
Dastur kodi.
MyForm.h #pragma once namespace Amaliy2 { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// /// public ref class MyForm : public System::Windows::Forms::Form { public:
MyForm(void) { InitializeComponent(); // //TODO: добавьте код конструктора // }
/// /// Освободить все используемые ресурсы. /// ~MyForm() { if (components) { delete components; } }
private: System::Windows::Forms::ComboBox^ comboBox1; private: System::Windows::Forms::ComboBox^ comboBox2; private: System::Windows::Forms::Label^ label1; private: System::Windows::Forms::Label^ label2; private: /// /// Обязательная переменная конструктора. /// System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// /// Требуемый метод для поддержки конструктора — не изменяйте /// содержимое этого метода с помощью редактора кода. /// void InitializeComponent(void) { System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid)); this->comboBox1 = (gcnew System::Windows::Forms::ComboBox()); this->comboBox2 = (gcnew System::Windows::Forms::ComboBox()); this->label1 = (gcnew System::Windows::Forms::Label()); this->label2 = (gcnew System::Windows::Forms::Label()); this->SuspendLayout(); // // comboBox1 // this->comboBox1->BackColor = System::Drawing::Color::FromArgb(static_cast static_cast this->comboBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast this->comboBox1->FormattingEnabled = true; this->comboBox1->ItemHeight = 24; this->comboBox1->Items->AddRange(gcnew cli::array< System::Object^ >(8) { L"Axmadjon", L"Askarjon", L"Adhamjon", L"Axrorjon", L"Akmaljon", L"Kamoliddin", L"Akromjon", L"Abrorjon" }); this->comboBox1->Location = System::Drawing::Point(149, 588); this->comboBox1->Name = L"comboBox1"; this->comboBox1->Size = System::Drawing::Size(242, 32); this->comboBox1->TabIndex = 2; // // comboBox2 // this->comboBox2->BackColor = System::Drawing::Color::FromArgb(static_cast static_cast this->comboBox2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast this->comboBox2->FormattingEnabled = true; this->comboBox2->ItemHeight = 24; this->comboBox2->Items->AddRange(gcnew cli::array< System::Object^ >(8) { L"Axmadjon", L"Askarjon", L"Adhamjon", L"Axrorjon", L"Akmaljon", L"Kamoliddin", L"Akromjon", L"Abrorjon" }); this->comboBox2->Location = System::Drawing::Point(451, 590); this->comboBox2->Name = L"comboBox2"; this->comboBox2->Size = System::Drawing::Size(242, 32); this->comboBox2->TabIndex = 3; this->comboBox2->SelectedIndexChanged += gcnew System::EventHandler(this, &MyForm::comboBox2_SelectedIndexChanged_1); // // label1 // this->label1->AutoSize = true; this->label1->BackColor = System::Drawing::Color::White; this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast this->label1->Location = System::Drawing::Point(397, 591); this->label1->Name = L"label1"; this->label1->Size = System::Drawing::Size(33, 24); this->label1->TabIndex = 4; this->label1->Text = L"ga"; // // label2 // this->label2->AutoSize = true; this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast this->label2->Location = System::Drawing::Point(734, 598); this->label2->Name = L"label2"; this->label2->Size = System::Drawing::Size(0, 24); this->label2->TabIndex = 5; // // MyForm // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->BackgroundImage = (cli::safe_cast this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None; this->ClientSize = System::Drawing::Size(940, 655); this->Controls->Add(this->label2); this->Controls->Add(this->label1); this->Controls->Add(this->comboBox2); this->Controls->Add(this->comboBox1); this->DoubleBuffered = true; this->Name = L"MyForm"; this->Text = L"MyForm"; this->ResumeLayout(false); this->PerformLayout(); } #pragma endregion private: System::Void comboBox2_SelectedIndexChanged_1(System::Object^ sender, System::EventArgs^ e) { if (comboBox1->Text == "Abrorjon") { if (comboBox2->Text == "Abrorjon") label2->Text = "Mantiqsiz so'rov kiritdingiz!"; else if (comboBox2->Text == "Akromjon") label2->Text = "Uka bo'ladi"; else if (comboBox2->Text == "Askarjon") label2->Text = "Ada bo'ladi"; else if (comboBox2->Text == "Adhamjon") label2->Text = "Amaki bo'ladi"; else if (comboBox2->Text == "Axrorjon") label2->Text = "Amaki bo'ladi"; else if (comboBox2->Text == "Akmaljon") label2->Text = "Amaki bo'ladi"; else if (comboBox2->Text == "Komoliddin") label2->Text = "Amaki bo'ladi"; else if (comboBox2->Text == "Axmadjon") label2->Text = "Ota bo'ladi"; } if (comboBox1->Text == "Akromjon") { if (comboBox2->Text == "Akromjon") label2->Text = "Mantiqsiz so'rov kiritdingiz!"; else if (comboBox2->Text == "Abrorjon") label2->Text = "Aka bo'ladi"; else if (comboBox2->Text == "Askarjon") label2->Text = "Ada bo'ladi"; else if (comboBox2->Text == "Adhamjon") label2->Text = "Amaki bo'ladi"; else if (comboBox2->Text == "Axrorjon") label2->Text = "Amaki bo'ladi"; else if (comboBox2->Text == "Akmaljon") label2->Text = "Amaki bo'ladi"; else if (comboBox2->Text == "Komoliddin") label2->Text = "Amaki bo'ladi"; else if (comboBox2->Text == "Axmadjon") label2->Text = "Ota bo'ladi"; } if (comboBox1->Text == "Askarjon") { if (comboBox2->Text == "Askarjon") label2->Text = "Mantiqsiz so'rov kiritdingiz!"; else if (comboBox2->Text == "Akromjon") label2->Text = "O'g'il bo'ladi"; else if (comboBox2->Text == "Abrorjon") label2->Text = "O'g'il bo'ladi"; else if (comboBox2->Text == "Adhamjon") label2->Text = "Uka bo'ladi"; else if (comboBox2->Text == "Axrorjon") label2->Text = "Uka bo'ladi"; else if (comboBox2->Text == "Akmaljon") label2->Text = "Uka bo'ladi"; else if (comboBox2->Text == "Komoliddin") label2->Text = "Uka bo'ladi"; else if (comboBox2->Text == "Axmadjon") label2->Text = "Ada bo'ladi"; } if (comboBox1->Text == "Adhamjon") { if (comboBox2->Text == "Adhamjon") label2->Text = "Mantiqsiz so'rov kiritdingiz!"; else if (comboBox2->Text == "Akromjon") label2->Text = "Jiyan bo'ladi"; else if (comboBox2->Text == "Abrorjon") label2->Text = "Jiyan bo'ladi"; else if (comboBox2->Text == "Askarjon") label2->Text = "Aka bo'ladi"; else if (comboBox2->Text == "Axrorjon") label2->Text = "Uka bo'ladi"; else if (comboBox2->Text == "Akmaljon") label2->Text = "Uka bo'ladi"; else if (comboBox2->Text == "Komoliddin") label2->Text = "Uka bo'ladi"; else if (comboBox2->Text == "Axmadjon") label2->Text = "Ada bo'ladi"; } if (comboBox1->Text == "Axrorjon") { if (comboBox2->Text == "Axrorjon") label2->Text = "Mantiqsiz so'rov kiritdingiz!"; else if (comboBox2->Text == "Akromjon") label2->Text = "Jiyan bo'ladi"; else if (comboBox2->Text == "Abrorjon") label2->Text = "Jiyan bo'ladi"; else if (comboBox2->Text == "Askarjon") label2->Text = "Aka bo'ladi"; else if (comboBox2->Text == "Adhamjon") label2->Text = "Aka bo'ladi"; else if (comboBox2->Text == "Akmaljon") label2->Text = "Uka bo'ladi"; else if (comboBox2->Text == "Komoliddin") label2->Text = "Uka bo'ladi"; else if (comboBox2->Text == "Axmadjon") label2->Text = "Ada bo'ladi"; } if (comboBox1->Text == "Akmaljon") { if (comboBox2->Text == "Akmaljon") label2->Text = "Mantiqsiz so'rov kiritdingiz!"; else if (comboBox2->Text == "Akromjon") label2->Text = "Jiyan bo'ladi"; else if (comboBox2->Text == "Abrorjon") label2->Text = "Jiyan bo'ladi"; else if (comboBox2->Text == "Askarjon") label2->Text = "Aka bo'ladi"; else if (comboBox2->Text == "Adhamjon") label2->Text = "Aka bo'ladi"; else if (comboBox2->Text == "Axrorjon") label2->Text = "Aka bo'ladi"; else if (comboBox2->Text == "Komoliddin") label2->Text = "Uka bo'ladi"; else if (comboBox2->Text == "Axmadjon") label2->Text = "Ada bo'ladi"; } if (comboBox1->Text == "Komoliddin") { if (comboBox2->Text == "Komoliddin") label2->Text = "Mantiqsiz so'rov kiritdingiz!"; else if (comboBox2->Text == "Akromjon") label2->Text = "Jiyan bo'ladi"; else if (comboBox2->Text == "Abrorjon") label2->Text = "Jiyan bo'ladi"; else if (comboBox2->Text == "Askarjon") label2->Text = "Aka bo'ladi"; else if (comboBox2->Text == "Adhamjon") label2->Text = "Aka bo'ladi"; else if (comboBox2->Text == "Axrorjon") label2->Text = "Aka bo'ladi"; else if (comboBox2->Text == "Akmaljon") label2->Text = "Aka bo'ladi"; else if (comboBox2->Text == "Axmadjon") label2->Text = "Ada bo'ladi"; } if (comboBox1->Text == "Axmadjon") { if (comboBox2->Text == "Axmadjon") label2->Text = "Mantiqsiz so'rov kiritdingiz!"; else if (comboBox2->Text == "Akromjon") label2->Text = "Nabira bo'ladi"; else if (comboBox2->Text == "Abrorjon") label2->Text = "Nabira bo'ladi"; else if (comboBox2->Text == "Askarjon") label2->Text = "O'g'il bo'ladi"; else if (comboBox2->Text == "Adhamjon") label2->Text = "O'g'il bo'ladi"; else if (comboBox2->Text == "Axrorjon") label2->Text = "O'g'il bo'ladi"; else if (comboBox2->Text == "Akmaljon") label2->Text = "O'g'il bo'ladi"; else if (comboBox2->Text == "Komoliddin") label2->Text = "O'g'il bo'ladi"; } } }; }
#include "MyForm.h" using namespace System; using namespace System::Windows::Forms; [STAThread] void main(array Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); Amaliy2::MyForm form; Application::Run(% form); } Download 0.55 Mb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling