3. Flowcharts favouriteColour
The Pseudocode below prompts the user to enter a colour, then prints it out.
Indenting means adding tabs at the beginning of lines to visually group related statements.
Indent after control statements like IF, ELSE, ELSEIF, WHILE, FOR.
Unindent after closing blocks like ENDIF, ENDWHILE, ENDFOR.
The pseudocode below has errors. See the questions for the corrections.
ALGORITHM favouriteColour()
START
PRINT "What is your favorite colour?"
INPUT colour
PRINT colour + " is lovely!"
END
Tasks
In the incorrect pseudocode above, what keypress is missing before each PRINT and INPUT statements? Mark it in before each of the 3 lines.
In the incorrect pseudocode above, what keypress is missing before each PRINT and INPUT statements? Mark it in before each of the 3 lines.
The TAB character is used to indent the code.
START
PRINT "What is your favorite colour?"
INPUT colour
PRINT colour + " is lovely!"
END