Warning! It seems that you are using Dodona within another webpage, so not everything may work properly. Let your teacher know so that he can solve the problem by adjusting a setting in the learning environment. In the meantime, you can click this link to open Dodona in a new window.
Warning! The page was not fully loaded, probably because of a network issue. It could be that not all functionalities work as expected. Please try reloading the page.
H5 Beslissingen - BMI calculator uitgebreid onder, normaal, overgewicht en obesistas
Sign in to test your solution.
using System;
namespace BMI_uitgebreid_if_elseif_else
{
public class Program
{
public static void Main(string[] args)
{
//variabelen declareren
double lengte, lengteInMeter,gewicht, bmi;
//gegevens opvragen
Console.WriteLine("Geef uw lengte in cm: ");
lengte = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Geef uw gewicht in kg: ");
gewicht = Convert.ToDouble(Console.ReadLine());
//berekening uitvoeren
//lengte in cm omzetten naar meter
lengteInMeter = lengte / 100;
//berekening BMI
bmi = gewicht / Math.Pow(lengteInMeter, 2);
//afronden
bmi = Math.Round(bmi, 2);
//kleef jouw code hieronder
}
}
}