Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1repeat ... until choice = 4 | Ainput choice | |
| 2else print "Invalid choice" | BTells the user their entry is not a menu option, then the loop shows the menu again | |
| 3Each pass of the loop reads the user's menu choice so the program can select an action | CThe menu is printed after the choice is read, so the user is asked for input before seeing the options. print the menu first, then input choice. | |
| 4A second menu option is checked with else if after the first option's if | DThe menu offers 3 as the exit option but the loop ends on 4, so choosing Exit never stops the loop. The until condition must be choice = 3. | |
| 5repeat print "1 Add 2 View 3 Exit" input choice ... until choice = 4 | Eelse if choice = 2 then | |
| 6repeat input choice print "Choose 1, 2 or 3" if choice = 1 then ... | FKeeps showing the menu and acting on the choice until the user picks 4, the exit option |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
repeat ... until choice = 4 — A menu loop: repeat shows the menu, reads the choice, picks an action with if or else if, and stops on the exit choice. Any other value gets an invalid choice message.repeat
print "1 Play 2 Scores 3 Help 4 Exit"
input choiceprint "Enter your choice:"
input choice
if choice = 1 thenif choice = 1 then
print "Starting game"
else if choice = 2 then print "Help"
else
print "Invalid choice" print "4 = Exit"
input choice
until choice = 4