GTU OOP Program - 4

4). Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. Write a program that prompts the user to enter a weight in pounds and height in inches and displays the BMI.
Note:- 1 pound=.45359237 Kg and 1 inch=.0254 meters.

import java.util.Scanner;

class Program_04 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter your weight in Pound : ");
        double weight = input.nextDouble();
        System.out.print("Enter your height in inches : ");
        double height = input.nextDouble();

        double BMI = (weight * 0.45359237) / ((height * 0.0254) * (height * 0.0254));

        System.out.print("BMI = " + BMI);
    }
}

Output
cse gtu, gtu study material for computer engineering students gujarat technological university oop lab manual solution

gtu oop lab manual,

oop GTU Practical,

oop Programs,

Object oriented Programming,

Gtu study material 3140705,

OOP 3140705,

oop practical list,

Java Programming,

gtu oop practical,

oop lab solution gtu

Comments

YouTube

Popular posts from this blog

GTU OOP Program - 18

GTU OS Program - 7

GTU OS Program - 3