
-----------------------------------
J2S
Thu Nov 23, 2006 8:54 pm

How easy is this program?
-----------------------------------
I'm trying to make one that has the user enter a series of numbers and the program will find the largest number once the user exits. It's kind of hard though. Someone help.  :shock:

-----------------------------------
ericfourfour
Thu Nov 23, 2006 9:02 pm


-----------------------------------
Well you get a number see if it is greater than the largest. If it is it becomes the largest. Repeat.

-----------------------------------
J2S
Thu Nov 23, 2006 9:05 pm


-----------------------------------
loop
    exit when num = -999
    get num
    n := n + 1
    if n > num then
    
end loop


-----------------------------------
J2S
Thu Nov 23, 2006 9:06 pm


-----------------------------------
I still don't understand it. Harhar  :oops:

-----------------------------------
ericfourfour
Thu Nov 23, 2006 10:14 pm


-----------------------------------
This is not a hard problem. If you want to keep track of the largest number what do you do? If you want to check if a number is greater than the largest number what do you do?

-----------------------------------
Clayton
Thu Nov 23, 2006 10:20 pm


-----------------------------------

loop
    get a number
    exit if number = -1000000 (or whatever you want)
    if the number is bigger than the previous number, it is now the largest number
end loop
output the largest number

