Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-10-2004, 08:01 PM   PM User | #1
JAVAEOC
Regular Coder

 
Join Date: Oct 2003
Location: SC
Posts: 936
Thanks: 0
Thanked 0 Times in 0 Posts
JAVAEOC is an unknown quantity at this point
Java and 0

I wrote a programm and now i am having truble with the number 0....

What the programm does:
You enter two names and their test scores, then the programm comares their highscores and says who has the highest...

However when i put in 0 for one of the scores it thinks that 0 is higher then 100, why?

thanks...

the zip: http://free.networkthai.net/x/someone/Student.zip
__________________
http://www.bluephoenix.uni.cc/
JAVAEOC is offline   Reply With Quote
Old 06-10-2004, 10:29 PM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Are you converting the numbers to integers or floats before you compare them? If not then you are likely comparing the ascii values of the characters 0 and 100 and not actually the value 0 and 100.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 06-10-2004, 10:55 PM   PM User | #3
JAVAEOC
Regular Coder

 
Join Date: Oct 2003
Location: SC
Posts: 936
Thanks: 0
Thanked 0 Times in 0 Posts
JAVAEOC is an unknown quantity at this point
Yes they are int... So what is wrong? did u look at my script?

thanks
__________________
http://www.bluephoenix.uni.cc/
JAVAEOC is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:50 PM.


Advertisement
Log in to turn off these ads.