Results 1 to 5 of 5
Thread: Need help asap please!
- 08-12-2010, 02:20 PM #1
Member
- Join Date
- Aug 2010
- Posts
- 2
- Rep Power
- 0
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...
if anyone can make it any more simple then please do....and also add the the weight status table if its possibleJava 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 = "); } }
thhanx in advance!Last edited by Fubarable; 08-12-2010 at 03:07 PM. Reason: code
-
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.i managed to create this as simple as i can i have ONE ERROR...
- 08-12-2010, 02:50 PM #3
Member
- Join Date
- Aug 2010
- Posts
- 2
- Rep Power
- 0
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.
-
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:
I've added tags to your post above.Java Code:[code] // your code goes here // notice how the top and bottom tags are different [/code]
- 08-12-2010, 03:57 PM #5
Similar Threads
-
Need some help ASAP
By varma in forum New To JavaReplies: 11Last Post: 01-08-2010, 12:15 AM -
HELP PLEASE! Need reply ASAP
By SteroidalPsycho in forum New To JavaReplies: 3Last Post: 10-21-2009, 08:28 AM -
Need answer asap!!!
By uranis_khai in forum New To JavaReplies: 3Last Post: 07-07-2009, 09:48 AM -
Need Java Help ASAP
By L-dog in forum New To JavaReplies: 22Last Post: 10-02-2008, 11:54 PM -
array problems need your help ASAP!
By notherand in forum New To JavaReplies: 1Last Post: 06-29-2008, 08:59 PM


LinkBack URL
About LinkBacks


Bookmarks