Results 1 to 5 of 5
  1. #1
    mbm4ever is offline Member
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Default Need help asap please!

    am from the u.k and a newbie to java and i need to create a Body Mass Index Calculator....ive been trying for awhile going through java books but can't seem to get it right....can any one please create a BMI calculator which is really simple and shows weight status table. i have to create this table using Jpad pro....only the javascript code is required so it works without errors when compiled on Jpad pro.

    i managed to create this as simple as i can i have ONE ERROR...

    Java Code:
    public class BMI
    {
    
    public static void main(String[] args) {
    int weight; //weight
    int height; //height
    int BMI; //BMI
    char Overweight=0; //Overweight
    char Normal_Weight=0; //Normal Weight
    char Underweight=0; //Underweight
    Scanner input = new Scanner(System.in);
    
    System.out.print("Enter the weight: ");
    weight = input.nextInt();
    System.out.print("Enter the height: ");
    height = input.nextInt();
    input.close();
    
    BMI = weight / height;
    System.out.println("BMI (Body Mass Index): " + BMI);
    if (BMI >= 25 ) {
    BMI = Overweight;
    System.out.print("BMI = ");
    }
    }
    if anyone can make it any more simple then please do....and also add the the weight status table if its possible

    thhanx in advance!
    Last edited by Fubarable; 08-12-2010 at 03:07 PM. Reason: code

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by mbm4ever View Post
    ...can any one please create a BMI calculator which is really simple and shows weight status table.

    ....

    if anyone can make it any more simple then please do....and also add the the weight status table if its possible
    NO! We are not here to do your homework. Please don't ask this again.

    i managed to create this as simple as i can i have ONE ERROR...
    Tell us your errors including the actual error messages and we'll be more than happy to try to help you with your code, but again, we are not here to help you cheat.

  3. #3
    mbm4ever is offline Member
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by Fubarable View Post
    NO! We are not here to do your homework. Please don't ask this again.


    Tell us your errors including the actual error messages and we'll be more than happy to try to help you with your code, but again, we are not here to help you cheat.
    its an assignment

    error is ...

    ---------------- JDK Debug Build ------------------
    Compiling H:\New Folder (3)\dhondhuuuuuuuuuuuuuuuuuu\BMI.java
    The current directory is: H:\New Folder (3)\dhondhuuuuuuuuuuuuuuuuuu
    Command line: "C:\Java\jdk1.6.0_14\bin\javac.exe" -deprecation -g -classpath H:\NEWFOL~3\DHONDH~1 "H:\New Folder (3)\dhondhuuuuuuuuuuuuuuuuuu\BMI.java"
    H:\New Folder (3)\dhondhuuuuuuuuuuuuuuuuuu\BMI.java:32: reached end of file while parsing
    }
    ^
    1 error
    Finished

    dnt get it at alll :-S

    this is my code but i have used bits from other ones jus to try make work.....
    Last edited by mbm4ever; 08-12-2010 at 02:53 PM.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    The error seems to be telling you that you are missing an end curly brace.

    Also, when posting code here, please use code tags so that your code will retain its formatting and thus will be readable -- after all, your goal is to get as many people to read your post and understand your code as possible, right?

    To do this, highlight your pasted code (please be sure that it is already formatted when you paste it into the forum; the code tags don't magically format unformatted code) and then press the code button, and your code will have tags.

    Another way to do this is to manually place the tags into your code by placing the tag [code] above your pasted code and the tag [/code] below your pasted code like so:

    Java Code:
    [code]
      // your code goes here
      // notice how the top and bottom tags are different
    [/code]
    I've added tags to your post above.

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,332
    Rep Power
    25

Similar Threads

  1. Need some help ASAP
    By varma in forum New To Java
    Replies: 11
    Last Post: 01-08-2010, 12:15 AM
  2. HELP PLEASE! Need reply ASAP
    By SteroidalPsycho in forum New To Java
    Replies: 3
    Last Post: 10-21-2009, 08:28 AM
  3. Need answer asap!!!
    By uranis_khai in forum New To Java
    Replies: 3
    Last Post: 07-07-2009, 09:48 AM
  4. Need Java Help ASAP
    By L-dog in forum New To Java
    Replies: 22
    Last Post: 10-02-2008, 11:54 PM
  5. array problems need your help ASAP!
    By notherand in forum New To Java
    Replies: 1
    Last Post: 06-29-2008, 08:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •