Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Test
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double BMI, masa, wzrost;
  14.  
  15.             Console.WriteLine("Podaj wagę [kg]: ");
  16.             masa = double.Parse(Console.ReadLine());
  17.  
  18.             Console.WriteLine("Podaj wzrost [m]: ");
  19.             wzrost = double.Parse(Console.ReadLine());
  20.  
  21.             BMI = (masa*100.0) / (wzrost*2.0);
  22.  
  23.             if (BMI > 18.5 && BMI < 25.0)
  24.             {
  25.                 Console.WriteLine("Waga prawidłowa");
  26.             }
  27.             else
  28.             {
  29.                 if (BMI < 18.5)
  30.                 {
  31.                     Console.WriteLine("Niedowaga");
  32.                 }
  33.                 else
  34.                 {
  35.                     Console.WriteLine("Nadwaga");
  36.                 }
  37.             }
  38.  
  39.  
  40.  
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement