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 | |
|---|---|---|
| 1Student | name: string, age: integer | getAge(), setAge(newAge) | AStudent | name: string, age: integer | getAge(), setAge(newAge) | |
| 2name: string, age: integer | BA complete object description: the object name, its attributes with data types, then its methods | |
| 3A requirement says a library must record each book's title and number of pages, so the object is Book and only those two attributes are needed | CThe attributes part of the description: each data item the object stores, with its data type | |
| 4Methods are named with the same convention as the rest of the program (camelCase), starting with a verb such as get or set | DThe attributes have no data types. They should be written as name: string, age: integer. | |
| 5Student | name, age | getAge(), setAge(newAge) | EfavouriteColour is not needed by the requirement. Only relevant attributes should be included, so it should be removed. | |
| 6Student | name: string, age: integer, favouriteColour: string | getAge() | FBook | title: string, pages: integer | getTitle(), getPages() |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
object description — Names an object, its attributes with data types and its methods, using only what the requirement needs. Example: Student has name: string, age: integer, getAge().Requirement: store a pet's name and age
Pet | name: string, age: integer | getAge()Requirement: an item has a name and cost
Item | name: string, cost: float | getCost()Requirement: show a dog's name
Dog | name: string, age: integer | getName()Requirement: a cat's age can be changed
Cat | age: integer | setAge(newAge)Requirement: store a car's make and year
Car | make: string, year: integer | getYear()