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 | |
|---|---|---|
| 1MAX_STUDENTS = 30 | AA constant named in UPPER_SNAKE_CASE so it stands out as a value that should not change | |
| 2class StudentRecord: | Bfirst_name = "Ava" last_name = "Nguyen" year_level = 7 | |
| 3A meaningful name describes what the data stores, so the code is easy to read | CThe variable names mix snake_case, PascalCase and camelCase, so the program is inconsistent | |
| 4Consistency means using the same naming pattern for every variable throughout a program | Dtotal_price = quantity * unit_price | |
| 5x = 15 y = 4 z = x * y | EA class name written in PascalCase, with each word starting with a capital letter | |
| 6first_name = "Liam" LastName = "Smith" yearLevel = 8 | FThe names x, y and z are not meaningful, so a reader cannot tell what the values represent |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
naming convention — An agreed pattern for naming variables, functions, classes and constants so code is consistent, uses meaningful names and is easy to read.total_marks = 78 + 85
average_mark = total_marks / 2class StudentRecord:
pass
rec = StudentRecord()GST_RATE = 0.1
price = 50
total = price + price * GST_RATEdef calculate_total(price, qty):
return price * qty
cost = calculate_total(4, 3)min_mark = 0
max_mark = 100
print(min_mark, max_mark)