Código fuente utilizado - Video #6
En el presente articulo encontrarás el código utilizado para la realización de estructuras condicionales en C#.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Math;
using System.Threading.Tasks;
namespace Proyecto1
{
class Program
{
static void Main(string[] args)
{
//Declaración de variables
double temperatura = 0;
//Entrada de datos
Console.WriteLine("Ingrese la temperatura: ");
temperatura = Convert.ToDouble(Console.ReadLine());
verificador(temperatura);
//Proceso
Console.ReadKey();
}
public static void verificador(double temperatura)
{
if (temperatura > 41)
{
Console.WriteLine("Usted tiene Hipertermia");
}
else
{
if(temperatura > 39.5 & temperatura <= 41)
{
Console.WriteLine("Usted tiene una fiebre alta");
}
else
{
if(temperatura > 37.5 & temperatura <= 39.5)
{
Console.WriteLine("Usted tiene una fiebre");
}
else
{
if(temperatura >= 36 & temperatura <= 37.5)
{
Console.WriteLine("Usted tiene una temperatura corporal normal");
}
else
{
if(temperatura < 36 & temperatura > 0)
{
Console.WriteLine("Usted tiene Hipotermia");
}
else
{
Console.WriteLine("Temperatura ingresada invalida para este ambito");
}
}
}
}
}
}
}
}