In this c# program please convert into c++ program and please put the height (feet into inches. 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"); } } } }
In this 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 sample output of this program.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images