Results 1 to 20 of 20
 10252011, 10:56 PM #1Member
 Join Date
 Oct 2011
 Posts
 5
 Rep Power
 0
 10252011, 11:14 PM #2Member
 Join Date
 Oct 2011
 Posts
 90
 Rep Power
 0
Re: Find the Biggest Number + Smallest
Well, you will need to have all of those scores available to you at the end of your loop to determine the smallest and biggest. Do you know how to store several numbers that are related?
 10252011, 11:16 PM #3Member
 Join Date
 Oct 2011
 Posts
 5
 Rep Power
 0
Re: Find the Biggest Number + Smallest
arent the stored numbers in "total"?
 10252011, 11:17 PM #4
 10252011, 11:19 PM #5Member
 Join Date
 Oct 2011
 Posts
 5
 Rep Power
 0
 10252011, 11:22 PM #6
Re: Find the Biggest Number + Smallest
Do you know how to declare variables?
Do you know how to assign values to variables?
Do you know how to use if statements?
If you answered yes to all three questions then you know how to do it.
 10252011, 11:22 PM #7Member
 Join Date
 Oct 2011
 Posts
 90
 Rep Power
 0
Re: Find the Biggest Number + Smallest
Although true Junky, I imagine an introduction to the Math library would be beneficial in a beginners programming class.
 10252011, 11:24 PM #8
Re: Find the Biggest Number + Smallest
What the heck has a Math Library got to do with it?
 10252011, 11:24 PM #9Member
 Join Date
 Oct 2011
 Posts
 5
 Rep Power
 0
Re: Find the Biggest Number + Smallest
Thats like no help. If I knew how to do it, I wouldnt be asking for help. I need someone to explain it

Re: Find the Biggest Number + Smallest
You'll want to declare two variables before the while loop, a highest and a lowest variable, and then inside of the loop check to see if any entered values are higher than the highest or lower than the lowest. You can initialize the highest value with the lowest possible int available, Integer.MAX_VALUE and the high variable with Integer.MIN_VALUE.
 10252011, 11:25 PM #11
Re: Find the Biggest Number + Smallest
Well give up then!
I gave you all the help you need. If you do not know how to do any of those things I mentioned then you either need to do some serious revision or drop the course.
 10252011, 11:26 PM #12Member
 Join Date
 Oct 2011
 Posts
 90
 Rep Power
 0
Re: Find the Biggest Number + Smallest
Well I was going to suggest using min and max...
d4, what is your min and max before you start? How about after the first loop iteration? The second? etc

Re: Find the Biggest Number + Smallest
It's usually best to at least give a stab at it, try to solve this little issue and show us your attempt before completely giving in and throwing in the towel. Also, it's not a good a idea to say "that's like no help". Even if you don't see his point, he did take time out to consider your problem and try to help you, so being rude to him will only make him and others not want to help you in the future.

Re: Find the Biggest Number + Smallest
 10252011, 11:29 PM #15Member
 Join Date
 Oct 2011
 Posts
 5
 Rep Power
 0
 10252011, 11:32 PM #16
Re: Find the Biggest Number + Smallest
Open wide here comes the choochoo train.
Java Code:int max = Integer.MIN_VALUE; int min = Integer.MAX_VALUE;
Java Code:if current value is less than min min = current value if current value is greater than max max = current value
 10252011, 11:33 PM #17
Re: Find the Biggest Number + Smallest
Well I was trying to help by getting you to think for yourself but all you did was throw your arms up in the air and whine "I don't know how to do it" without even trying. My above post just about gives you the solution. Are you happy now?
 10252011, 11:33 PM #18Member
 Join Date
 Oct 2011
 Posts
 90
 Rep Power
 0
Re: Find the Biggest Number + Smallest
D4, sorry you had a bad experience man, but these forums are mostly good. Some people here simply find it easier to be rude than explain why they aren't going to give you the answer.
 10252011, 11:39 PM #19
Re: Find the Biggest Number + Smallest
My posting style can be rough to those who appear not to try and solve the problem themselves and just expect to be given the answer. This is the attitude I was getting from the OP.
 10262011, 06:43 AM #20
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 13,458
 Blog Entries
 7
 Rep Power
 20
Similar Threads

Help me with my biggest project
By ron2794 in forum New To JavaReplies: 0Last Post: 06102011, 05:55 PM 
smallest number java program
By elmo in forum New To JavaReplies: 9Last Post: 11182010, 09:29 PM 
Find max number in 2D array?
By spatel14 in forum New To JavaReplies: 3Last Post: 06302010, 04:27 PM 
html, biggest nightmare ever
By dinosoep in forum New To JavaReplies: 9Last Post: 12032009, 08:50 AM 
Find nth root of a number
By perito in forum New To JavaReplies: 1Last Post: 03032008, 06:51 AM
Bookmarks