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 | |
|---|---|---|
| 1UCASE("Happy") | AIF UCASE(Answer) = "YES" THEN | |
| 2Initial ← UCASE('q') | BStores the CHAR 'Q' in Initial because UCASE also works on a single CHAR | |
| 3UCASE does not change the original variable unless you assign the result back to it | CName ← UCASE(Name) | |
| 4UCASE makes comparing text fair, because both sides are converted to the same case | DIf the user types yes or Yes, the comparison fails because the case differs. Use UCASE(Answer) = "YES" to compare fairly. | |
| 5UCASE(Name) OUTPUT Name | EThe result of UCASE is thrown away, so Name is unchanged and the output is still the original text. Assign it: Name ← UCASE(Name) | |
| 6IF Answer = "YES" THEN | FReturns the text "HAPPY" with every letter changed to upper case |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
UCASE(x) — UCASE(x) returns the string or CHAR x with every letter in upper case. UCASE("Happy") returns "HAPPY". The original variable only changes if you assign the result.OUTPUT UCASE("Happy")Word ← UCASE(Word)DECLARE Letter : CHAR
Letter ← 'q'
OUTPUT UCASE(Letter)IF UCASE(Answer) = "YES" THEN
OUTPUT "Correct"
ENDIFWord ← "Happy"
Big ← UCASE(Word)
OUTPUT Word