1. Member
Join Date
Sep 2009
Posts
31
Rep Power
0

hello everyone. im new here and also a beginner to java. I have a college professor who does not explain anything and just expects us to know how. so i have a pretty simple question here.

ok were just doing pseudocode right now not actual java. but im stuck on a concept. the question is...in pseudocode...

Read some grades until a -999 is entered. find and display the lowest of these grades. This is what i have so far..

Begin-
While not equal to -999
.....

thats where i am stuck, not sure what to say after that haha. so please help a noob out over here! thanks

2. Here's a trick: Say you're a scribe with nothing more than a pencil and a pad of paper, and someone is telling you numbers until they tell you -999, and given this information you must tell him at the end the lowest number.

The key here is to think of the steps required to do something like this without a computer, with just the paper and pad as noted above. Try to describe the exact steps required, break the steps down into their most atomic sub-step, and from these steps the pseudocode (and eventually the code) will flow naturally. Well, how about giving it a go? Much luck!

edit: oh, by the way, get used to having to learn because of or despite your teachers. You'll find that in college and in life, the ultimate responsibility for learning is not the teacher's but yours. You can do it but it may require more effort. Again, luck.
Last edited by Fubarable; 09-15-2009 at 05:31 PM.

3. Member
Join Date
Sep 2009
Posts
31
Rep Power
0
i just dont understand how to use the while statements well enough. i dont know what to say because i dont know what to compare the lowest number to, you know what i mean?

4. Member
Join Date
Sep 2009
Posts
31
Rep Power
0
well i would take down all the numbers to be recorded...go through them and find the lowest number...

Last edited by shroomiin; 09-15-2009 at 10:20 PM.

5. Again, find the smallest sub steps here, the "atomic" steps. Myself, I would:
ask the fellow for a number
if it's not the sentinel number (-999), write it down.
if it's not the sentinel number (-999), and if it's lower then the current number, write it down.
if it's not the sentinel number (-999), and if it's lower then the current number, write it down.
if it's not the sentinel number (-999), and if it's lower then the current number, write it down.
if it's not the sentinel number (-999), and if it's lower then the current number, write it down.
... (see anything "looping" here?)
until the sentinel number has been reached, then return the last number I've written down.

Next I'd take these steps and try to create a loop that would simplify this.

6. Member
Join Date
Sep 2009
Posts
31
Rep Power
0
wow thanks. that really helped me out, i couldnt see it like that for some reason...heres what i came up with..

Begin-
Smallest number=j
While grade is not equal to -999
End while
Display J
-end.

thats probably still wrong but not as bad haha

#### Posting Permissions

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