using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace c6_4 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } int[,] score = new int[2,3]; double[] avg = new double[2]; double classAvg; private void button1_Click(object sender, EventArgs e) { score[0, 0] = int.Parse(textBox1_1.Text); score[0, 1] = int.Parse(textBox1_2.Text); score[0, 2] = int.Parse(textBox1_3.Text); score[1, 0] = int.Parse(textBox2_1.Text); score[1, 1] = int.Parse(textBox2_2.Text); score[1, 2] = int.Parse(textBox2_3.Text); //avg avg[0] = (score[0, 0] + score[0, 1] + score[0, 2]) / 3; avg[1] = (score[1, 0] + score[1, 1] + score[1, 2]) / 3; textBox1_4.Text = avg[0].ToString(); textBox2_4.Text = avg[1].ToString(); //class avg classAvg = (avg[0] + avg[1]) / 2; textBox_avg.Text = classAvg.ToString(); } } }