I am trying to get this code to work so when a numbers are put in the length and width text boxes they are calculated to come up with the area and perimeter. This is for a class assignment and my teacher is telling me that I am not correctly displaying the calculated results in the output text boxes. I would love it if someone tell me how to edit my code so that it will run correctly. Thank you.
private void btnCalculatE_Click(object sender, EventArgs e)
{
double Length;
double Width;
double txtArea;
double txtPerimeter;
Length = Convert.ToDouble(txtLength.Text);
Width = Convert.ToDouble(txtWidth.Text);
txtArea = Length * Width;
txtPerimeter = 2 * (Length + Width);
txtArea = Convert.ToDouble(txtArea);
txtPerimeter = Convert.ToDouble(txtPerimeter);
txtLength.Focus();
}
private void btnExiT_Click(object sender, EventArgs e)
{
this.Close();
}