Microsoft Word Karimova Charos kurs ishi
Download 1.76 Mb. Pdf ko'rish
|
1 2
Bog'liqKarimova Charos kurs ishi.
partial class Form1 : Form { public Form1() { InitializeComponent(); this .Text = "Test" ; } StreamReader s, j; string [] savol = new string [10]; string [] a = new string [10]; string [] b = new string [10]; string [] c = new string [10]; char [] javoblar = new char [10]; char javob; string str = "" ; int togri = 0, notogri = 0, i = 0; private void ochishToolStripMenuItem_Click( object sender, EventArgs e) { openFileDialog1.ShowDialog(); button1.Enabled = true ; try { s = new StreamReader (openFileDialog1.FileName); for ( int i = 0; i < 10; i++) { savol[i] = s.ReadLine(); a[i] = s.ReadLine(); b[i] = s.ReadLine(); c[i] = s.ReadLine(); } } catch { }; } private void chiqishToolStripMenuItem_Click( object sender, EventArgs e) { Close(); } private void Form1_Load( object sender, EventArgs e) { 30 Form form2 = new Form (); int k = 0; j = new StreamReader ( "Javoblar.txt" ); while ((str = j.ReadLine()) != null ){ if (k < 10) { javoblar[k] = str[str.Length - 1]; k++; } } radioButton1.Visible = false ; radioButton2.Visible = false ; radioButton3.Visible = false ; button2.Enabled = false ; button1.Enabled = false ; label3.Visible = false ; label4.Visible = false ; label5.Visible = false ; } private void button1_Click( object sender, EventArgs e) { button1.Visible = false ; listBox1.Items.Add(savol[i]); label3.Text = a[i]; label4.Text = b[i]; label5.Text = c[i]; button2.Enabled = false ; radioButton1.Visible = true ; label3.Visible = true ; radioButton2.Visible = true ; label4.Visible = true ; radioButton3.Visible = true ; label5.Visible = true ; button1.Enabled = false ; button2.Enabled = false ; radioButton1.Checked = false ; radioButton2.Checked = false ; radioButton3.Checked = false ; } private void button2_Click( object sender, EventArgs e) { button1.Visible = false ; if (javob == javoblar[i]) { togri++; label6.Text = togri.ToString(); } else { notogri++; label7.Text = notogri.ToString(); } i++; if (i == 10) { int summa = togri*100/i; MessageBox .Show(FISh+ "\t\t\n\n\t\t\tSizning natijanggiz:" + "\t\t\n\n\t\tSavollar soni: " + i + "\t\t\n\n\t\t" + " 100% lik natijadan " + "\t\t\n\n\t\t" + " to'plagan foiz natijangiz: " + summa.ToString() + "%\t\t\n\n" ); listBox1.Items.Clear(); i = 0; button2.Enabled = false ; radioButton1.Checked = false ; radioButton2.Checked = false ; radioButton3.Checked = false ; label6.Text = "0" ; label7.Text = "0" ; ActiveForm.Close(); } else { listBox1.Items.Clear(); listBox1.Items.Add(savol[i]); label3.Text = a[i]; label4.Text = b[i]; label5.Text = c[i]; button2.Enabled = false ; radioButton1.Checked = false ; 31 radioButton2.Checked = false ; radioButton3.Checked = false ; } } private void radioButton1_CheckedChanged( object sender, EventArgs e) { if (radioButton1.Checked) { button2.Enabled = true ; button2.Focus(); javob = 'a' ; } } private void radioButton2_CheckedChanged( object sender, EventArgs e) { if (radioButton2.Checked) { button2.Enabled = true ; button2.Focus(); javob = 'b' ; } } private void radioButton3_CheckedChanged( object sender, EventArgs e) { if (radioButton3.Checked) { button2.Enabled = true ; button2.Focus(); javob = 'c' ; } } private void label1_Click( object sender, EventArgs e) { } private void pictureBox1_Click( object sender, EventArgs e) { } private void label6_Click( object sender, EventArgs e) { } private void listBox1_SelectedIndexChanged( object sender, EventArgs e) { } private void textBox2_TextChanged( object sender, EventArgs e) { } string FISh; private void button3_Click( object sender, EventArgs e) { FISh = textBox1.Text + " " + textBox2.Text; textBox1.Clear(); textBox2.Clear(); label8.Visible = false ; label9.Visible = false ; textBox1.Visible = false ; textBox2.Visible = false ; button3.Visible = false ; label1.Visible = true ; label2.Visible = true ; label3.Visible = true ; label4.Visible = true ; label5.Visible = true ; 32 label6.Visible = true ; label7.Visible = true ; button1.Visible = true ; button2.Visible = true ; listBox1.Visible = true ; ochishToolStripMenuItem.Visible = true ; } private void textBox1_TextChanged( object sender, EventArgs e) { } private void pictureBox3_Click( object sender, EventArgs e) { } } } Download 1.76 Mb. Do'stlaringiz bilan baham: |
1 2
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling