Jump to content

import java.util.Scanner;

public class test {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner inp = new Scanner(System.in);

        System.out.print("Input weight in killgrams: ");
        double weight = inp.nextDouble();
        System.out.print("Input height in killgrams: ");
        double height = inp.nextDouble();

        double myBMI = bmi(weight, height);
        System.out.printf("BMI = %.2f", myBMI);

        if (myBMI < 18.5) {
            System.out.println(" is belongs to Underweight");
        } else if (myBMI < 24.9) {
            System.out.println(" is belongs to Normal weight");
        } else if (myBMI < 29.9) {
            System.out.println(" is belongs to Overweight");
        } else  {
            System.out.println(" is belongs to obese");
        }

    }

    public static double bmi(double weight, double height) {
        return weight / (height * height);

    }

}

Link to comment
https://linustechtips.com/topic/1003347-please-explain-this-java-code-to-me/
Share on other sites

Link to post
Share on other sites

Almost all your posts seem to be you asking us to do your homework. You're not gonna learn anything this way.

 

Plus this is super simple code, have a good long look at it and you'll figure it out

75% of what I say is sarcastic

 

So is the rest probably

Link to post
Share on other sites

27 minutes ago, myselfolli said:

Almost all your posts seem to be you asking us to do your homework. You're not gonna learn anything this way.

 

Plus this is super simple code, have a good long look at it and you'll figure it out

how do you know all my post

Link to post
Share on other sites

And you know what's funny? This is not the first time this has been explained to you: https://linustechtips.com/main/topic/998176-java-problem/?tab=comments#comment-11993111

 

Please stop trying to get us to do your homework. We're happy to help if there are any real problems, but we're not a homework forum

75% of what I say is sarcastic

 

So is the rest probably

Link to post
Share on other sites

45 minutes ago, myselfolli said:

And you know what's funny? This is not the first time this has been explained to you: https://linustechtips.com/main/topic/998176-java-problem/?tab=comments#comment-11993111

 

Please stop trying to get us to do your homework. We're happy to help if there are any real problems, but we're not a homework forum

but i provide the code.The code is answer.

Link to post
Share on other sites

2 minutes ago, buklu said:

宜家似個傻屄

I don't know what your problem with IKEA is exactly, but okay...

 

Yes, you provide the code. You get it from your professor or teacher or whoever gives you your homework and you pass it straight onto us. Congratulations, you know how to copy and paste. You aren't going to learn anything this way and you're wasting our time while you're at it. Please stop

75% of what I say is sarcastic

 

So is the rest probably

Link to post
Share on other sites

Guest
This topic is now closed to further replies.

×