You are on page 1of 3

Exercício 1

private void btnCalcular_Click(object sender, EventArgs e)


{
txtRes.Text = "Introduziu o número: " + txtN1.Text + " e o " + txtN2.Text;
}

Exercício 2

private void btnCalcular_Click(object sender, EventArgs e)


{
double raio=0;
raio = Convert.ToDouble(txtRaio.Text);
txtRes.Text = (Math.PI * Math.Pow(raio, 2)).ToString("0.000 m2");
}
Exercício 3

private void btnCalcular_Click(object sender, EventArgs e)


{
int num;
num = Convert.ToInt16(txtInt.Text);
txtAnterior.Text = (num - 1).ToString();
txtSeguinte.Text = (num + 1).ToString();
}

Exercício 4

private void btnCalcular_Click(object sender, EventArgs e)


{
double T1, T2, T3, media;
T1 = Convert.ToDouble(txtT1.Text);
T2 = Convert.ToDouble(txtT2.Text);
T3 = Convert.ToDouble(txtT3.Text);
media = (T1 + T2 + T3) / 3;

txtRes.Text = media.ToString("0.000");
}
Exercício 5

private void btnCalcular_Click(object sender, EventArgs e)


{
double alt = 0;
alt = Convert.ToDouble(txtAltura.Text);
txtPh.Text = ((alt * 72.7) - 58).ToString("0.00 kg");
txtPm.Text = ((alt * 62.1) - 44.7).ToString("0.00 kg");
}

Exercício 6

private void btnConverter_Click(object sender, EventArgs e)


{
double cent = 0;
cent = Convert.ToDouble(txtCent.Text);

txtRes.Text = (((9 * cent) + 160) / 5).ToString("0.00");


}

You might also like