Chapter 1b - How do computers fit in with the world around them? Flashcards

1
Q

Objects represent:

A

Each physical thing in the world
e.g. Car and Hotel
There is one instance of the hotel and one instance of the car

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Each object can have its own:

A

Properties
Events
Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Properties are…

A

The characteristics of an object

e.g. Color / engine size / current speed of a car

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Properties are made up of…

A

Name
Value
e.g. Name: Car colour / Value: Red

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Events are…

A

A computer’s way of putting up its hand and saying: “This just happened!”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When an event is triggered…

A

It is used to trigger a certain section of code
A script will state which events a programmer wants to respond to and what part of the script should then run.
e.g. In a hotel a book event will increment the value of the bookings property by one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Methods are…

A

Things people need to do with objects

They can retrieve or update the values of an object’s properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does a Method do?

A

The code for a method can contain lots of instructions that together represent one task
When you use a method, you might not need to know how it achieves its task, rather just how to ask a question, and how to interpret any answers.
e.g. checkAvailability() will subtract the value of the bookings property from the value of the rooms property to return the number of rooms available.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Web Browsers create models of..

A

The web page they are showing - Document Object

The browser window that the page is being shown in - Window Object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The Document Object represents…

A

An HTML page
Properties - Describe characteristics of the current web page - e.g. title
Methods - Perform tasks associated with the document currently loaded in the browser
Such as getting info from a specified element
Or Adding new content
Events - Responds to e.g. user clicking or tapping on an element

All browser makers implement the DOM in the same way meaning you already have

Properties that you can access to find out about the current page
Methods to help you achive some common tasks

When a browser creates a model of a page, it creates a new object for each element on the page. This, along with the document object, is called…

The Document Object Model - DOM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A browser sees a web page in the following way:

A

Receive the page as HTML
Create a model of the page and store it in memory
Uses a rendering engine to display the page onscreen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A subsection of the DOM is called a…

A

Node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Javascript instructions are interpreted by a part of the browser called an…

A

Interpreter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In Javascript, each line of code is run one by one. This is because JavaScript is an:

A

Interpreted Programming Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly