Smilin
May 6th 2006, 4:48 am
Hey guys.. I'm a newbie to JavaScript :o
I'm new to the forums, so i hope im not doing anything wrong by posting this here :)
Im reading from a worksheet i have here, and i dont quite understand it..
Hopefully somebody else can lay it out in English for me? haha
The question is as follows.
"Write a program which takes a series of positive integers as input : 1, 2, 3 …
When input is complete, as indicated by entry of an end of data flag ( -2), the program will output the largest of the entered values."
Here's the pseudocode, or structured english? too it.
INPUT number
INPUT anotherNumber
DOWHILE anotherNumber > 0
IF anotherNumber > number
SET number = anotherNumber
ENDIF
DISPLAY prompt for anotherNumber
INPUT anotherNumber
END DOWHILE
DISPLAY number
I've spent the last 3 hours trying to work it out, but im totally mind boggled now :eek:
Any help at all is really appreciated, thank you :)
I'm new to the forums, so i hope im not doing anything wrong by posting this here :)
Im reading from a worksheet i have here, and i dont quite understand it..
Hopefully somebody else can lay it out in English for me? haha
The question is as follows.
"Write a program which takes a series of positive integers as input : 1, 2, 3 …
When input is complete, as indicated by entry of an end of data flag ( -2), the program will output the largest of the entered values."
Here's the pseudocode, or structured english? too it.
INPUT number
INPUT anotherNumber
DOWHILE anotherNumber > 0
IF anotherNumber > number
SET number = anotherNumber
ENDIF
DISPLAY prompt for anotherNumber
INPUT anotherNumber
END DOWHILE
DISPLAY number
I've spent the last 3 hours trying to work it out, but im totally mind boggled now :eek:
Any help at all is really appreciated, thank you :)