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 EX1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public class Student
        {
           private long Code;
           private string Name,Family,FName;
           private float CourseScore1, CourseScore2, CourseScore3;

           public long StCode
           {
               get { return Code; }
               set { Code = value; }
           }
            public string StName
            {
                get { return Name; }
                 set{Name=value;}
            }
            public string StFamily
            {
                get { return Family; }
                set { Family = value; }
            }
            public string StFName
            {
                get { return FName; }
                set { FName = value; }
            }
            public float GetCS1
            {
                get { return CourseScore1; }
            }
            public float GetCS2
            {
                get { return CourseScore2; }
            }
            public float GetCS3
            {
                get { return CourseScore3; }
            }
            public  Student(float CS1)
            {
                CourseScore1 = CS1;
                CourseScore2 = 0;
                CourseScore3 = 0;
            }
            public Student(float CS1,float CS2)
            {
                CourseScore1 = CS1;
                CourseScore2 = CS2;
                CourseScore3 = 0;

            }
            public Student(float CS1, float CS2,float CS3)
            {
                CourseScore1 = CS1;
                CourseScore2 = CS2;
                CourseScore3 = CS3;

            }
            public float Average()
            {
               
                return (CourseScore1+CourseScore2+CourseScore3)/3;
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
           //***********Student 1***********************
            Student st1 = new Student(10, 12.25f, 15);
            st1.StCode = 80512036;
            st1.StName = "Ali";
            st1.StFamily = "Rezaei";
            st1.StFName = "Hassan";
            lblCode1.Text = st1.StCode.ToString();
            lblName1.Text=st1.StName;
            lblFamily1.Text=st1.StFamily;
            lblFName1.Text=st1.StFName;
            lblCS11.Text= st1.GetCS1.ToString();
            lblCS21.Text = st1.GetCS2.ToString();
            lblCS31.Text = st1.GetCS3.ToString();
            lblAverage1.Text = st1.Average().ToString();
            //***********Student 2***********************
            Student st2 = new Student(15.5f, 16);
            st2.StCode = 80523036;
            st2.StName = "MirSaleh";
            st2.StFamily = "Gorteishy";
            st2.StFName = "Ali";
            lblCode2.Text = st2.StCode.ToString();
            lblName2.Text = st2.StName;
            lblFamily2.Text = st2.StFamily;
            lblFName2.Text = st2.StFName;
            lblCS12.Text = st2.GetCS1.ToString();
            lblCS22.Text = st2.GetCS2.ToString();
            lblCS32.Text = st2.GetCS3.ToString();
            lblAverage2.Text = st2.Average().ToString();
            //***********Student 3***********************
            Student st3 = new Student(15.5f);
            st3.StCode = 81533046;
            st3.StName = "Abbas";
            st3.StFamily = "Gorbani";
            st3.StFName = "Hosein";
            lblCode3.Text = st3.StCode.ToString();
            lblName3.Text = st3.StName;
            lblFamily3.Text = st3.StFamily;
            lblFName3.Text = st3.StFName;
            lblCS13.Text = st3.GetCS1.ToString();
            lblCS23.Text = st3.GetCS2.ToString();
            lblCS33.Text = st3.GetCS3.ToString();
            lblAverage3.Text = st3.Average().ToString();
        }
    }
}
