When entering the temperature value, I must determine the type of climate. must be done with Windows forms.
Temperature 10 and = 21 and 30 = Tropical
This is the code I have:
private void btnAceptar_Click(object sender, EventArgs e)
{
if (txtTipoClima.Text == string.Empty)
{
MessageBox.Show("Debe ingresar la Temperatura (Solo Números)", "Mensaje del Sistema", MessageBoxButtons.OK);
}
else
{
if (temperatura <10)
{
MessageBox.Show("Frio", "Mensaje del Sistema", MessageBoxButtons.OK);
}
else
{
if (temperatura >10 && temperatura <= 20)
{
MessageBox.Show("Nublado", "Mensaje del Sistema", MessageBoxButtons.OK);
}
else
{
if (temperatura >= 21 && temperatura <= 30)
{
MessageBox.Show("Calor", "Mensaje del Sistema", MessageBoxButtons.OK);
}
else
{
if (temperatura > 30)
{
MessageBox.Show("Tropical", "Mensaje del Sistema", MessageBoxButtons.OK);
}
}
}
}
}
}
I can not define all types of temperature, only this fragment of the code works:
if (temperatura <10)
{
MessageBox.Show("Frio", "Mensaje del Sistema", MessageBoxButtons.OK);