In this c# program please provide the height (feet and inches) in this program and please show the picture of the output. Source Code:
In this c#
Source Code:
//C# Source Code :-
using System;
namespace BMI
{
internal class Program
{
static void Main(string[] args)
{
float bmi, m, h;
String name;
Console.Write("Enter the student name: ");
name = Console.ReadLine();
Console.Write("\nEnter the grade level(1-6): ");
h = float.Parse(Console.ReadLine());
Console.Write("\nEnter the student Weight(kg): ");
m = float.Parse(Console.ReadLine());
bmi = m / (h * h);
Console.WriteLine("\nStudent BMI is: " + bmi);
if(bmi < 18.5)
{
Console.WriteLine("\nStudent is Underweight");
}
else if(bmi >= 18.5 && bmi < 25)
{
Console.WriteLine("\nStudent is Normal Weight");
}
else if(bmi >= 25 && bmi < 30)
{
Console.WriteLine("\nStudent is Overweight");
}
else
{
Console.WriteLine("\nStudent is Obese");
}
}
}
}
See the picture below that's instruction of the program and formula.
Step by step
Solved in 3 steps with 2 images