Last active
August 29, 2015 14:04
-
-
Save RenatoRosaFranco/23ffe0183be5b1df8157 to your computer and use it in GitHub Desktop.
IMC C# - Renato Rosa Franco
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Recebe as Variaveis | |
string nome; | |
double altura, peso, imc; | |
// Pega o Alvo | |
Console.Write("Digite seu nome : "); | |
nome = Console.ReadLine(); | |
Console.Write("Digite Sua Altura : "); | |
altura = Double.Parse(Console.ReadLine()); | |
Console.Write("Digite o seu peso :"); | |
peso = Double.Parse(Console.ReadLine()); | |
imc = peso / (altura * altura); | |
Console.Write("\n" + Math.Round(imc,1)); | |
// Pega o Alvo | |
if (imc < 17) | |
{ Console.WriteLine("\nMuito abaixo do peso"); } | |
else if (imc > 17 & imc < 18.49) | |
{ Console.WriteLine("\n\nAbaixo do peso Ideal"); } | |
else if (imc > 18.5 & imc < 24.99) | |
{ Console.WriteLine("\n\nPeso Ideal"); } | |
else if (imc > 25 & imc < 29.99) | |
{ Console.WriteLine("\n\nAcima do peso Ideal"); } | |
else if (imc > 30 & imc < 34.49) | |
{ Console.WriteLine("\n\nObesidade"); } | |
else if (imc > 35 & imc < 39.99) | |
{ Console.WriteLine("\n\nObesidade Severa"); } | |
else if (imc > 40) | |
{ Console.WriteLine("\n\nObesidade Mórbida"); } | |
else | |
{ Console.WriteLine("\n\nNão Reconhecido"); } | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment