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 | |
|---|---|---|
| 1this.balance = 0; | Aconstructor(name, house) { this.name = name; this.house = house; } | |
| 2deposit(amount) { this.balance += amount; } | Bclass Player { jump() { console.log('Jump!'); } } | |
| 3Scenario: 'A student has a name and a house.' The nouns name and house are stored as properties. | CA method: the verb 'deposit' is an action the object can do | |
| 4Scenario: 'A game character can jump.' The verb jump becomes a method. | DBark is a verb (an action), so it should be a method, not a property. | |
| 5class Book { constructor(title, authorsFavouriteColour, coverPhotoSize) { } } | EA property: the noun 'balance' is data the object stores | |
| 6class Dog { constructor() { this.bark = 'Woof'; } } | FIt stores details the program does not need. Leave out unneeded detail like favourite colour and photo size. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
properties and methods — Read the scenario: nouns (data to store) become properties and verbs (actions) become methods. Keep only the details the program needs and leave the rest out.// Scenario: a student has a name.
constructor(name) { this.name = name; }// Scenario: a dog can bark.
class Dog {
bark() { console.log("Woof!"); }// A player can add points to the score.
player.addPoints(5);// Needed: title and borrowed (not colour)
this.borrowed = false;// A cat is hungry until it eats.
eat() { this.hungry = false; }