Tuesday , October 17 2017
Home / Research Papers / IT/Technology / CGPA Calculator in ASP.Net

CGPA Calculator in ASP.Net

(Cgpa calculator)

CGPA Calculator in ASP.Net

Code.aspx:

<%@ Page Title=”” Language=”C#” MasterPageFile=”~/Site.Master” AutoEventWireup=”true” CodeBehind=”cgpa.aspx.cs” Inherits=”studentDetails.cgpa” %>

<asp:Content ID=”Content1″ ContentPlaceHolderID=”HeadContent” runat=”server”>

</asp:Content>

<asp:Content ID=”Content2″ ContentPlaceHolderID=”MainContent” runat=”server”>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

<form style=”background:#FFFFFF”>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;<br />

<br />

<br />

&nbsp;&nbsp;

<strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Credit Hours </strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<strong>Grade</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<strong>Grade Points</strong><br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

Sbjct1:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox1″ runat=”server” height=”22px” width=”128px”></asp:TextBox>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:DropDownList ID=”DropDownList1″ runat=”server” height=”31px”

onselectedindexchanged=”DropDownList1_SelectedIndexChanged” width=”99px”

AutoPostBack=”True”>

<asp:ListItem Selected=”False”></asp:ListItem>

<asp:ListItem>A+</asp:ListItem>

<asp:ListItem>A</asp:ListItem>

<asp:ListItem>B+</asp:ListItem>

<asp:ListItem>B</asp:ListItem>

<asp:ListItem>B-</asp:ListItem>

<asp:ListItem>C+</asp:ListItem>

<asp:ListItem>C</asp:ListItem>

<asp:ListItem>D</asp:ListItem>

<asp:ListItem>F</asp:ListItem>

</asp:DropDownList>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox8″ runat=”server” height=”22px” width=”125px”></asp:TextBox>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

<br />

Sbjct2:&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox2″ runat=”server” height=”22px” width=”128px”

></asp:TextBox>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:DropDownList ID=”DropDownList2″ runat=”server” height=”31px”

onselectedindexchanged=”DropDownList2_SelectedIndexChanged”

style=”margin-left: 0px” width=”99px” AutoPostBack=”True”>

<asp:ListItem></asp:ListItem>

<asp:ListItem>A+</asp:ListItem>

<asp:ListItem>A</asp:ListItem>

<asp:ListItem>B+</asp:ListItem>

<asp:ListItem>B</asp:ListItem>

<asp:ListItem>B-</asp:ListItem>

<asp:ListItem>C+</asp:ListItem>

<asp:ListItem>C</asp:ListItem>

<asp:ListItem>D</asp:ListItem>

<asp:ListItem>F</asp:ListItem>

</asp:DropDownList>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

<br />

Sbjct3:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox3″ runat=”server” height=”22px” width=”128px”></asp:TextBox>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:DropDownList ID=”DropDownList3″ runat=”server” height=”31px”

onselectedindexchanged=”DropDownList3_SelectedIndexChanged” width=”99px”

AutoPostBack=”True”>

<asp:ListItem></asp:ListItem>

<asp:ListItem>A+</asp:ListItem>

<asp:ListItem>A</asp:ListItem>

<asp:ListItem>B+</asp:ListItem>

<asp:ListItem>B</asp:ListItem>

<asp:ListItem>B-</asp:ListItem>

<asp:ListItem>C+</asp:ListItem>

<asp:ListItem>C</asp:ListItem>

<asp:ListItem>D</asp:ListItem>

<asp:ListItem>F</asp:ListItem>

</asp:DropDownList>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox10″ runat=”server” height=”22px” width=”125px”></asp:TextBox>

<br />

<br />

Sbjct4:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox4″ runat=”server” height=”22px”

width=”128px”></asp:TextBox>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:DropDownList ID=”DropDownList4″ runat=”server” height=”31px”

onselectedindexchanged=”DropDownList4_SelectedIndexChanged” width=”99px”

AutoPostBack=”True”>

<asp:ListItem></asp:ListItem>

<asp:ListItem>A+</asp:ListItem>

<asp:ListItem>A</asp:ListItem>

<asp:ListItem>B+</asp:ListItem>

<asp:ListItem>B</asp:ListItem>

<asp:ListItem>B-</asp:ListItem>

<asp:ListItem>C+</asp:ListItem>

<asp:ListItem>C</asp:ListItem>

<asp:ListItem>D</asp:ListItem>

<asp:ListItem>F</asp:ListItem>

</asp:DropDownList>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox11″ runat=”server” height=”22px” width=”125px”></asp:TextBox>

<br />

<br />

Sbjct5:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox5″ runat=”server” height=”22px” width=”128px”></asp:TextBox>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:DropDownList ID=”DropDownList5″ runat=”server” height=”31px”

onselectedindexchanged=”DropDownList5_SelectedIndexChanged” width=”99px”

AutoPostBack=”True”>

<asp:ListItem></asp:ListItem>

<asp:ListItem>A+</asp:ListItem>

<asp:ListItem>A</asp:ListItem>

<asp:ListItem>B+</asp:ListItem>

<asp:ListItem>B</asp:ListItem>

<asp:ListItem>B-</asp:ListItem>

<asp:ListItem>C+</asp:ListItem>

<asp:ListItem>C</asp:ListItem>

<asp:ListItem>D</asp:ListItem>

<asp:ListItem>F</asp:ListItem>

</asp:DropDownList>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox12″ runat=”server” height=”22px” width=”125px”></asp:TextBox>

<br />

<br />

Sbjct6:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox6″ runat=”server” height=”22px” width=”125px”></asp:TextBox>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:DropDownList ID=”DropDownList6″ runat=”server” height=”31px”

onselectedindexchanged=”DropDownList6_SelectedIndexChanged” width=”99px”

AutoPostBack=”True”>

<asp:ListItem></asp:ListItem>

<asp:ListItem>A+</asp:ListItem>

<asp:ListItem>A</asp:ListItem>

<asp:ListItem>B+</asp:ListItem>

<asp:ListItem>B</asp:ListItem>

<asp:ListItem>B-</asp:ListItem>

<asp:ListItem>C+</asp:ListItem>

<asp:ListItem>C</asp:ListItem>

<asp:ListItem>D</asp:ListItem>

<asp:ListItem>F</asp:ListItem>

</asp:DropDownList>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox13″ runat=”server” height=”22px” width=”125px”></asp:TextBox>

<br />

&nbsp;<br />

Sbjct7:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox7″ runat=”server” Width=”125px” height=”22px”></asp:TextBox>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:DropDownList ID=”DropDownList7″ runat=”server” Height=”31px” Width=”99px”

onselectedindexchanged=”DropDownList7_SelectedIndexChanged”

AutoPostBack=”True”>

<asp:ListItem></asp:ListItem>

<asp:ListItem>A+</asp:ListItem>

<asp:ListItem>A</asp:ListItem>

<asp:ListItem>B+</asp:ListItem>

<asp:ListItem>B</asp:ListItem>

<asp:ListItem>B-</asp:ListItem>

<asp:ListItem>C+</asp:ListItem>

<asp:ListItem>C</asp:ListItem>

<asp:ListItem>D</asp:ListItem>

<asp:ListItem>F</asp:ListItem>

</asp:DropDownList>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox ID=”TextBox14″ runat=”server” Width=”125px”></asp:TextBox>

<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:Button ID=”Btncalculate” runat=”server” height=”50px”

onclick=”Btncalculate_Click” style=”font-weight: 700; font-size: large; margin-left: 264px;”

Text=”Calculate Cgpa” width=”179px” />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>

&nbsp;</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;

&nbsp;&nbsp;

<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:Button ID=”BtnReset” runat=”server” onclick=”btnReset Click”

style=”font-weight: 700; font-size: large; margin-left: 305px;”

Text=”Reset” Width=”95px” Height=”36px” />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>&nbsp;</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong> Your

Total GPA is&nbsp;</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<asp:TextBox

ID=”TextBox17″ runat=”server” height=”31px” width=”128px”></asp:TextBox>

<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<br />

<br />

</form>

</asp:Content>

Code Behind Calculate Button:

Cgpa.aspx:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

namespace studentDetails

{

public partial class cgpa : System.Web.UI.Page

{

static double q = 0.0, g = 0.0;

string g1=”A+”;

string g2 = “A”;

string g3 = “B+”;

string g4 = “B”;

string g5 = “B-“;

string g6 = “C+”;

string g7 = “C”;

string g8 = “D”;

string g9 = “F”;

protected void Page_Load(object sender, EventArgs e)

{

}

void fun1()

{

double c,gep;

string a;

a = DropDownList1.Text;

c = double.Parse(TextBox1.Text);

q = (q + c);

if (string.Compare(a,g1)==0)

{

gep = 4.0;

g = (g + (gep * c));

TextBox8.Text = (gep * c).ToString();

}

else if (string.Compare(a, g2) == 0)

{

gep = 3.7;

g = (g + (gep * c));

TextBox8.Text = (gep* c).ToString();

}

else if (string.Compare(a, g3) == 0)

{

gep = 3.4;

g = (g + (gep * c));

TextBox8.Text = (gep * c).ToString();

}

else if (string.Compare(a, g4) == 0)

{

gep = 3;

g = (g + (gep * c));

TextBox8.Text = (gep* c).ToString();

}

else if (string.Compare(a, g5) == 0)

{

gep = 2.5;

g = (g + (gep * c));

TextBox8.Text = (gep * c).ToString();

}

else if (string.Compare(a,g6)==0)

{

gep = 2;

g = (g + (gep * c));

TextBox8.Text = (gep * c).ToString();

}

else if (string.Compare(a,g7)==0)

{

gep = 1.5;

g = (g + (gep * c));

TextBox8.Text = (gep * c).ToString();

}

else if (string.Compare(a, g8) == 0)

{

gep = 1;

g = (g + (gep * c));

TextBox8.Text = (gep* c).ToString();

}

else if (string.Compare(a, g9) == 0)

{

gep = 0;

g = (g + (gep * c));

TextBox8.Text = (gep* c).ToString();

}

}

void fun2()

{

double c, gep;

string a;

a = DropDownList2.Text;

c = double.Parse(TextBox2.Text);

q = (q + c);

if (a == g1)

{

gep = 4;

g = (g + (gep * c));

TextBox9.Text = (gep * c).ToString();

}

else if (a == g2)

{

gep = 3.7;

g = (g + (gep * c));

TextBox9.Text = (gep * c).ToString();

}

else if (a == g3)

{

gep = 3.4;

g = (g + (gep * c));

TextBox9.Text = (gep * c).ToString();

}

else if (a == g4)

{

gep = 3;

g = (g + (gep * c));

TextBox9.Text = (gep * c).ToString();

}

else if (a == g5)

{

gep = 2.5;

g = (g + (gep * c));

TextBox9.Text = (gep * c).ToString();

}

else if (a == g6)

{

gep = 2;

g = (g + (gep * c));

TextBox9.Text = (gep * c).ToString();

}

else if (a == g7)

{

gep = 1.5;

g = (g + (gep * c));

TextBox9.Text = (gep * c).ToString();

}

else if (a == g8)

{

gep = 1;

g = (g + (gep * c));

TextBox9.Text = (gep * c).ToString();

}

else if (a == g9)

{

gep = 0;

g = (g + (gep * c));

TextBox9.Text = (gep * c).ToString();

}

}

void fun3()

{

double c, gep;

string a;

a = DropDownList3.Text;

c = double.Parse(TextBox3.Text);

q = (q + c);

if (a == g1)

{

gep = 4;

g = (g + (gep * c));

TextBox10.Text = (gep * c).ToString();

}

else if (a == g2)

{

gep = 3.7;

g = (g + (gep * c));

TextBox10.Text = (gep * c).ToString();

}

else if (a == g3)

{

gep = 3.4;

g = (g + (gep * c));

TextBox10.Text = (gep * c).ToString();

}

else if (a == g4)

{

gep = 3;

g = (g + (gep * c));

TextBox10.Text = (gep * c).ToString();

}

else if (a == g5)

{

gep = 2.5;

g = (g + (gep * c));

TextBox10.Text = (gep * c).ToString();

}

else if (a == g6)

{

gep = 2;

g = (g + (gep * c));

TextBox10.Text = (gep * c).ToString();

}

else if (a == g7)

{

gep = 1.5;

g = (g + (gep * c));

TextBox10.Text = (gep * c).ToString();

}

else if (a == g8)

{

gep = 1;

g = (g + (gep * c));

TextBox10.Text = (gep * c).ToString();

}

else if (a == g9)

{

gep = 0;

g = (g + (gep * c));

TextBox10.Text = (gep * c).ToString();

}

}

void fun4()

{

double c, gep;

string a;

a = DropDownList4.Text;

c = double.Parse(TextBox4.Text);

q = (q + c);

if (a == g1)

{

gep = 4;

g = (g + (gep * c));

TextBox11.Text = (gep * c).ToString();

}

else if (a == g2)

{

gep = 3.7;

g = (g + (gep * c));

TextBox11.Text = (gep * c).ToString();

}

else if (a == g3)

{

gep = 3.4;

g = (g + (gep * c));

TextBox11.Text = (gep * c).ToString();

}

else if (a == g4)

{

gep = 3;

g = (g + (gep * c));

TextBox11.Text = (gep * c).ToString();

}

else if (a == g5)

{

gep = 2.5;

g = (g + (gep * c));

TextBox11.Text = (gep * c).ToString();

}

else if (a == g6)

{

gep = 2;

g = (g + (gep * c));

TextBox11.Text = (gep * c).ToString();

}

else if (a == g7)

{

gep = 1.5;

g = (g + (gep * c));

TextBox11.Text = (gep * c).ToString();

}

else if (a == g8)

{

gep = 1;

g = (g + (gep * c));

TextBox11.Text = (gep * c).ToString();

}

else if (a == g9)

{

gep = 0;

g = (g + (gep * c));

TextBox11.Text = (gep * c).ToString();

}

}

void fun5()

{

double c, gep;

string a;

a = DropDownList5.Text;

c = double.Parse(TextBox5.Text);

q = (q + c);

if (a == g1)

{

gep = 4;

g = (g + (gep * c));

TextBox12.Text = (gep * c).ToString();

}

else if (a == g2)

{

gep = 3.7;

g = (g + (gep * c));

TextBox12.Text = (gep * c).ToString();

}

else if (a == g3)

{

gep = 3.4;

g = (g + (gep * c));

TextBox12.Text = (gep * c).ToString();

}

else if (a == g4)

{

gep = 3;

g = (g + (gep * c));

TextBox12.Text = (gep * c).ToString();

}

else if (a == g5)

{

gep = 2.5;

g = (g + (gep * c));

TextBox12.Text = (gep * c).ToString();

}

else if (a == g6)

{

gep = 2;

g = (g + (gep * c));

TextBox12.Text = (gep * c).ToString();

}

else if (a == g7)

{

gep = 1.5;

g = (g + (gep * c));

TextBox12.Text = (gep * c).ToString();

}

else if (a == g8)

{

gep = 1;

g = (g + (gep * c));

TextBox12.Text = (gep * c).ToString();

}

else if (a == g9)

{

gep = 0;

g = (g + (gep * c));

TextBox12.Text = (gep * c).ToString();

}

}

void fun6()

{

double c, gep;

string a;

a = DropDownList6.Text;

c = double.Parse(TextBox6.Text);

q = (q + c);

if (a == g1)

{

gep = 4;

g = (g + (gep * c));

TextBox13.Text = (gep * c).ToString();

}

else if (a == g2)

{

gep = 3.7;

g = (g + (gep * c));

TextBox13.Text = (gep * c).ToString();

}

else if (a == g3)

{

gep = 3.4;

g = (g + (gep * c));

TextBox13.Text = (gep * c).ToString();

}

else if (a == g4)

{

gep = 3;

g = (g + (gep * c));

TextBox13.Text = (gep * c).ToString();

}

else if (a == g5)

{

gep = 2.5;

g = (g + (gep * c));

TextBox13.Text = (gep * c).ToString();

}

else if (a == g6)

{

gep = 2;

g = (g + (gep * c));

TextBox13.Text = (gep * c).ToString();

}

else if (a == g7)

{

gep = 1.5;

g = (g + (gep * c));

TextBox13.Text = (gep * c).ToString();

}

else if (a == g8)

{

gep = 1;

g = (g + (gep * c));

TextBox13.Text = (gep * c).ToString();

}

else if (a == g9)

{

gep = 0;

g = (g + (gep * c));

TextBox13.Text = (gep * c).ToString();

}

}

void fun7()

{

double c, gep;

string a;

a = DropDownList7.Text;

c = double.Parse(TextBox7.Text);

q = (q + c);

if (a == g1)

{

gep = 4;

g = (g + (gep * c));

TextBox14.Text = (gep * c).ToString();

}

else if (a == g2)

{

gep = 3.7;

g = (g + (gep * c));

TextBox14.Text = (gep * c).ToString();

}

else if (a == g3)

{

gep = 3.4;

g = (g + (gep * c));

TextBox14.Text = (gep * c).ToString();

}

else if (a == g4)

{

gep = 3;

g = (g + (gep * c));

TextBox14.Text = (gep * c).ToString();

}

else if (a == g5)

{

gep = 2.5;

g = (g + (gep * c));

TextBox14.Text = (gep * c).ToString();

}

else if (a == g6)

{

gep = 2;

g = (g + (gep * c));

TextBox14.Text = (gep * c).ToString();

}

else if (a == g7)

{

gep = 1.5;

g = (g + (gep * c));

TextBox14.Text = (gep * c).ToString();

}

else if (a == g8)

{

gep = 1;

g = (g + (gep * c));

TextBox14.Text = (gep * c).ToString();

}

else if (a == g9)

{

gep = 0;

g = (g + (gep * c));

TextBox14.Text = (gep * c).ToString();

}

}

protected void Buttoncalculate_Click(object sender, EventArgs e)

{

TextBox15.Text = string.Empty;

TextBox15.Text = q.ToString();

TextBox18.Text=g.ToString();

TextBox17.Text = (g / q).ToString();

StudentEntities en = new StudentEntities(); ;

GPA gt = new GPA();

gt.gpaid = Convert.ToInt32(TextBox19.Text);

gt.gpa1 = Convert.ToDouble(TextBox17.Text);

en.GPAs.AddObject(gt);

if (en.SaveChanges() == 1)

{

Label1.Text = “GPA save Successfully”;

}

}

protected void Buttonclear_Click(object sender, EventArgs e)

{

TextBox1.Text = string.Empty;

TextBox2.Text = string.Empty;

TextBox3.Text = string.Empty;

TextBox4.Text = string.Empty;

TextBox5.Text = string.Empty;

TextBox6.Text = string.Empty;

TextBox7.Text = string.Empty;

TextBox8.Text = string.Empty;

TextBox9.Text = string.Empty;

TextBox10.Text = string.Empty;

TextBox11.Text = string.Empty;

TextBox12.Text = string.Empty;

TextBox13.Text = string.Empty;

TextBox14.Text = string.Empty;

TextBox15.Text = string.Empty;

TextBox18.Text = string.Empty;

TextBox17.Text = string.Empty;

TextBox19.Text = string.Empty;

DropDownList1.Text = “”;

DropDownList2.Text = “”;

DropDownList3.Text = “”;

DropDownList4.Text = “”;

DropDownList5.Text = “”;

DropDownList6.Text = “”;

DropDownList7.Text = “”;

Label1.Text = string.Empty;

}

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)

{

fun1();

}

protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)

{

fun2();

}

protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)

{

fun3();

}

protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)

{

fun4();

}

protected void DropDownList5_SelectedIndexChanged(object sender, EventArgs e)

{

fun5();

}

protected void DropDownList6_SelectedIndexChanged(object sender, EventArgs e)

{

fun6();

}

protected void DropDownList7_SelectedIndexChanged(object sender, EventArgs e)

{

fun7();

}

}

}

Leave a Reply

Your email address will not be published. Required fields are marked *