0% found this document useful (0 votes)
2 views2 pages

Example 2

The document outlines a grading system implemented in C# using ASP.NET. It includes functionality for calculating the total and average of five subject scores entered by the user through text boxes. Additionally, there is a reset button to clear the input and output fields.

Uploaded by

mohamedliban972
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Example 2

The document outlines a grading system implemented in C# using ASP.NET. It includes functionality for calculating the total and average of five subject scores entered by the user through text boxes. Additionally, there is a reset button to clear the input and output fields.

Uploaded by

mohamedliban972
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Example 2: Grading system

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Grading_system :


System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs
e)
{

}
protected void Button1_Click(object sender,
EventArgs e)
{
double sub1, sub2, sub3, sub4, sub5, total,
average;
sub1 = Convert.ToDouble(TextBox1.Text);
sub2 = Convert.ToDouble(TextBox2.Text);
sub3 = Convert.ToDouble(TextBox3.Text);
sub4 = Convert.ToDouble(TextBox4.Text);
sub5 = Convert.ToDouble(TextBox5.Text);
total = sub1 + sub2 + sub3 + sub4 + sub5;
average = total / 5;
TextBox6.Text = Convert.ToString(total);
TextBox7.Text = Convert.ToString(average);
}
protected void Button2_Click(object sender,
EventArgs e)
{
TextBox1.Text = " ";
TextBox2.Text = " ";
TextBox3.Text = " ";
TextBox4.Text = " ";
TextBox5.Text = " ";
TextBox6.Text = " ";
TextBox7.Text = " ";
}
}

You might also like