Newbie on C#.net
I have created a sample program that will add the 4 numbers and it will divide it to 4. Theres no error on the code but the output is wrong. . . i can't figure out what is worong. So please help meh. This is my code:
private void btnCalculateGrade_Click(object sender, System.EventArgs e)
{
double a;
a = double.Parse(this.txt1stgrading.Text) + double.Parse(this.txt2ndgrading.Text) + double.Parse(this.txt3rdgarding.Text) + double.Parse(this.txt4thgrading.Text) / 4;
this.lblTotal.Text = a.ToString();
}
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
li2 pointsPosted Oct 19, 2006, 9:25 PM EDT
You should add "("and ")".
like as (a+b+C+d)/4.