using System;
using System.Windows.Forms;

namespace _6_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        Student st;

        private void Form1_Load(object sender, EventArgs e)
        {
            label12.Text = "?";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            st.stNumber = Convert.ToInt32(textBox1.Text.Trim());
            st.name = textBox2.Text.Trim();
            st.family = textBox3.Text.Trim();
            st.lessons = new string[4];
            st.lessons[0] = textBox4.Text.Trim();
            st.lessons[1] = textBox5.Text.Trim();
            st.lessons[2] = textBox6.Text.Trim();
            st.lessons[3] = textBox7.Text.Trim();
            st.grades = new double[4];
            st.grades[0] = Convert.ToDouble(textBox8.Text.Trim());
            st.grades[1] = Convert.ToDouble(textBox9.Text.Trim());
            st.grades[2] = Convert.ToDouble(textBox10.Text.Trim());
            st.grades[3] = Convert.ToDouble(textBox11.Text.Trim());
        }

        private void button2_Click(object sender, EventArgs e)
        {
            double sum = 0;
            for (int i = 0; i < 4; i++)
            {
                sum = sum + st.grades[i];
                label12.Text = (sum  / 4).ToString(".00");
            }
        }
    }
}