
        private void button4_Click(object sender, EventArgs e)
        {
            textBox5.Visible = true;
            input = new FileStream("Student.Rnd", FileMode.Open, FileAccess.Read);
            binaryInput = new BinaryReader(input);
            double sum = 0;
            int count = 0;
            textBox5.Text = " Student are :";
            for (int i = 0; i < NUMBER_OF_REC; i++)
            {

                input.Seek((i) * randomAccessRecord.SIZE, 0);
                record.StNo = binaryInput.ReadInt32();
                record.fName = binaryInput.ReadString();
                record.lName = binaryInput.ReadString();
                record.Grade = binaryInput.ReadDouble();
                if (record.StNo != 0)
                {

                    sum += record.Grade;
                    count++;
                    string result = record.StNo.ToString() + "\t" + record.fName + "\t" + record.lName + "\t" + record.Grade.ToString();
                    textBox5.Text += "\r\n" + result;
                }
            }
            textBox5.Text += "\r\n" + "====================================";
            textBox5.Text += "\r\n" + "Average is: " + Convert.ToString((sum / count));
		
        }
