Operators 2 Flashcards
1
Q
How do you put output in pseudocode?
A
OUTPUT
e.g. OUTPUT age
2
Q
What do you put for converting to another data type?
A
STRING ()
INTEGER ()
FLOAT ()
e.g. STRING (age)
3
Q
What do you put for If?
A
IF condition THEN
block of statements
ENDIF
e.g.
IF answer is equal to guess THEN
OUTPUT “Correct!”
ENDIF
4
Q
What do you put for IF, ELSE?
A
IF condition THEN block of statements ELSE block of statements ENDIF
E.G. IF answer is equal to guess THEN OUTPUT “Correct!” ELSE OUTPUT “Incorrect!” ENDIF
5
Q
What do you put for If, elif, else?
A
IF condition THEN block of statements ELSEIF condition THEN block of statements ELSE block of statements END IF
e.g.
IF answer is equal to 5 THEN OUTPUT “Correct!” ELSEIF answer is equal to 6 OUTPUT “Almost” ELSE OUTPUT "Incorrect!" ENDIF
6
Q
What is For Loop in Pseudocode?
A
FOR … in … to …
block of statements
ENDFOR
i.e.
FOR i = 1 to 10
OUTPUT i
ENDFOR