Problem 1 in Pseudocode
Previous slide
Next slide
Back to first slide
View graphic version
PosSum <-- 0
NegSum <-- 0
Prompt <-- Enter Y to continue:
Echo <-- Your response was:
PUT Prompt
GET Response
PUT Echo Response
WHILE Response = Y
PUT Enter a number:
GET Number
PUT You entered: Number
IF Number >= 0
PosSum <-- PosSum + Number
ELSE
NegSum <-- NegSum + Number
ENDIF
PUT Prompt
GET Response
PUT Echo Response
ENDWHILE
PUT The positive sum is: PosSum
PUT The negative sum is: NegSum