1/112
Looks like no tags are added yet.
What is a computer?
A machine that works with information.
What is hardware? Give two examples.
The physical parts of a computer that you can see and touch, e.g. screen, keyboard, mouse, battery.
What is software? Give two examples.
The invisible instructions and apps that tell the hardware what to do, e.g. Google Chrome, Windows, video games.
Explain the guitar and sheet-music idea for hardware and software.
The guitar is the hardware and the sheet music is the software that tells you which strings to pluck. A guitar with no music makes no sound, and music with no guitar cannot be heard, so both must work together.
'Computers are smart, but blind.' What does this mean?
Computers cannot think for themselves. They only do exactly what humans tell them to do.
A tablet's screen and battery work perfectly, but the game will not open. Which half has failed? What does this show?
The software has failed. Hardware can work correctly and the system can still fail, because hardware needs working software to tell it what to do.
★ Study-guide extra: What is the difference between data and information? What does the CPU do?
Data = raw facts put into a computer. Information = data that has been processed into a meaningful form. The CPU (Central Processing Unit) carries out instructions and does calculations and logical operations.
List the four steps of the problem-solving process in order.
Define → Prepare → Try → Reflect.
What do you work out in the Define step?
What problem you are solving, what your constraints are, and what success looks like.
What happens in the Prepare step, and what questions does the Reflect step ask?
Prepare: brainstorm or research solutions, compare pros and cons, make a plan. Reflect: How do the results compare with my goals? What can I learn or do better? What new problems have I found?
In the newspaper-table challenge, name the step for each action: (a) sketching the design (b) adding books to test the table (c) asking why it fell.
(a) Prepare (b) Try (c) Reflect.
What is decomposition?
Breaking one big problem into small, bite-sized tasks.
Decompose the problem 'organize a class party' into three smaller tasks.
Any three sensible tasks, e.g. send invitations; prepare food and drinks; decorate the room and choose music.
What is an algorithm? If Algorithm A takes 10 steps and Algorithm B takes 3 steps to do the same job, which is more efficient?
An algorithm is a step-by-step list of instructions used to complete a task (like a recipe). Algorithm B is more efficient because it uses fewer steps, which saves memory and battery.
Put in the correct order: Bake for 30 minutes / Preheat the oven / Mix flour and sugar. What happens if the order is changed?
Preheat the oven → Mix flour and sugar → Bake for 30 minutes. If the order changes the cake is ruined, so the order of an algorithm matters.
What is a bug? What do we call finding and fixing it?
A bug is a mistake in your algorithm (or code). Finding and fixing it is called debugging.
Your character should turn right but turns left. Say what is wrong and how to fix it.
It is a bug (a wrong step). Debug it by finding the wrong instruction and changing it to turn right.
Explain the difference between an algorithm and a bug.
An algorithm is the plan (the list of steps). A bug is a mistake in that plan.
Is the first solution that works always the best? Give two questions you can ask to judge a solution.
No. A solution may work but be slow, unreliable, costly or hard to use. Ask: Is it efficient? Reliable? Affordable? Easy to use? Can it scale? Is it accessible?
★ Study-guide extra: Name the six stages of problem solving. Which stage checks whether the solution works?
Identify the problem, Analyse, Plan, Implement, Test and evaluate, Improve. 'Test and evaluate' checks whether it works.
Define input and output.
Input is the information a computer gets from users, devices or other computers. Output is the information a computer gives to users, devices or other computers.
Name three input methods and three output methods.
Input: keyboard, mouse, touchscreen, microphone, camera, sensors (GPS, temperature). Output: screen/display, speaker, printer, vibration, notifications.
Write I (input) or O (output): microphone, speaker, camera, printer, GPS sensor. Which device can be both?
microphone = I, speaker = O, camera = I, printer = O, GPS sensor = I. A touchscreen can be both: it detects touch (input) and displays information (output).
Give one example of input that does not come directly from the user.
Information from a sensor (e.g. GPS location in a navigation app) or from the internet.
What is processing? Name the four kinds of processing.
Processing is the thinking work a computer does to turn input into output. The four kinds: If/Then, Comparing, Finding a Match, Counting.
Name the kind of processing: (a) a quiz checks if your answer is the same as the right answer (b) an app searches a list for a contact name (c) an app shows how many steps you walked (d) if the password is right, unlock the phone.
(a) Comparing (b) Finding a Match (c) Counting (d) If/Then.
A calculator is used to work out 8 × 7. Identify the input, processing and output.
Input: 8, ×, 7. Processing: multiplies the numbers. Output: 56 shown on the screen.
Identify the input, processing and output when you search on Google.
Input: the words you type. Processing: finds web pages that match. Output: a list of results.
A birthday app asks for your birth date and shows one of three messages. What is the input and the output? How does it decide?
Input: the birth date. Output: one of three messages. It decides by comparing the date with today’s date, using if/then.
A computer processes perfectly but gives the wrong result. Give a likely reason.
The input was wrong. Wrong input gives a wrong result even if the processing is correct.
What is storage? Why does it matter?
Saving data so it can be used again later, even after the device is turned off. Without it an app would forget everything each time it closed.
What is temporary storage (RAM)? Use the whiteboard idea.
It holds data only while an app or device is running and the data disappears when it is closed. Like a whiteboard: useful while you work, then wiped clean.
What is permanent storage? Use the notebook idea.
It holds data even after the app closes or the device is turned off. Like a notebook: you write things down so you can look at them later.
What is cloud storage? Give one example and one reason to use it.
Saving data on remote servers over the internet instead of only on your device, e.g. Google Drive. Reasons: reach it from any device, back-up if the device is lost, easy sharing.
Write T (temporary) or P (permanent): 'typing…' indicator, saved photos, scroll position, game progress, unsent draft, contact list.
'typing…' = T, saved photos = P, scroll position = T, game progress = P, unsent draft = T, contact list = P
Why do apps need both temporary and permanent storage instead of just one?
Temporary storage holds quick working data that is not needed later. Permanent storage keeps what you want next time. Saving everything permanently would waste space.
Create: A fitness-tracker app. Name one input, one processing step, one output and one thing it should store permanently.
Example: Input: steps from a motion sensor. Processing: counting the steps. Output: step total shown on screen. Permanent storage: weekly step history.
If the storage failed but inputs and processing still worked, what would the user notice when reopening the app?
The app would forget everything every time it closed: logins, messages, progress and settings would be lost.
★ Study-guide extra: Which memory is volatile? Which storage has no moving parts? Which is larger, 1 GB or 1 MB?
RAM is volatile (loses its contents without power). An SSD uses flash memory and has no moving parts (an HDD has moving parts). 1 GB is larger than 1 MB. ROM keeps start-up instructions without power.
What is the difference between website content and website structure?
Content = the text and images on the website. Structure = how that content is organized.
What does HTML stand for? What is an element? Name the three parts of an element in <p>Hello</p>.
HyperText Markup Language. An element is a piece of a web page made with tags. Parts: opening tag <p>,content Hello, closing tag </p>.
Write the basic skeleton of a web page with the title 'My Site' and the heading 'Hi'. Which tag holds the visible content?
The <body> tag holds the visible content; <title> goes inside <head> and shows in the browser tab.
<!DOCTYPE html>
<html>
<head>
<title>My Site</title>
</head>
<body>
<h1>Hi</h1>
</body>
</htm
Which heading tag is largest and which is smallest? Predict the sizes, largest to smallest: <h3>Eggs</h3> <h1>Bacon</h1> <h6>Waffles</h6>
h1 is the largest and h6 the smallest (the bigger the number, the smaller the heading). Order: Bacon, Eggs, Waffles.
Write HTML for a paragraph that says 'I love cats.' and an unordered list titled 'Shopping List' with Milk and Eggs.
<p>I love cats.</p>
<h2>Shopping List</h2>
<ul>
<li>Milk</li>
<li>Eggs</li>
</ul>
Write an ordered (numbered) list with the heading 'Steps' and the items Wake, Eat, Study. How is it different from <ul>?
<ol> gives numbers; <ul> gives bullets. <li> marks each list item in both.
<h2>Steps</h2>
<ol>
<li>Wake</li>
<li>Eat</li>
<li>Study</li>
</ol>
Find and fix the errors: (a) <h1>My School<h1> (b) <p>Welcome to my page
(a) The closing tag needs a slash: <h1>My School</h1>. (b) The paragraph needs a closing tag: <p>Welcome to my page</p>.
How do you write a comment in HTML? Why use one?
<!-- this is a comment -->. It is a note for people reading the code; the browser does not show it.
Write the HTML to show an image called dog.jpg with the alternative text 'A dog'.
<img> has no closing tag.
<img src="dog.jpg" alt="A dog">
What do src and alt do? Does <img> need a closing tag? Which is the better alt text: 'pic' or 'A brown dog running on grass'?
src = where the image file is. alt = text shown or read aloud if the image cannot be seen. No closing tag is needed.
The second alt text is better because it describes the image.
What three things should you think about before using an image? Give two reasons websites use images.
Source (where is the file?), Alt text (what should a user know if they cannot see it?), Rights (are we allowed to use it, and did we credit the creator?). Images make pages more engaging, easier to understand, more informative and more memorable.
Write a link to the page about.html with the clickable text 'About Us'. Which part is the destination and which part is clickable?
href holds the destination (about.html). The text between <a> and </a> is the clickable text. If both files are in the same folder, the file name alone is a relative link.
<a href="about.html">About Us</a>
Mistakes: forgetting the closing </a>, wrong or misspelt file name in href, files in different folders, not testing
the link. Correct code is shown below.
<a href="contact.html">Contact</a>
Write HTML for an image logo.png with alt 'School logo', and a link to contact.html with the text 'Contact'.
Image uses src and alt; link uses href.
<img src="logo.png" alt="School logo">
<a href="contact.html">Contact</a>
Create: List the tags you would use to build a home page about your hobby, with a heading, a paragraph, a list, an image and a link.
Example: <h1> heading, <p> paragraph, <ul> and <li> list, <img src alt> image, <a href> link, all inside <body>.
★ Study-guide extra: What does <br> do? What is the difference between a web page, a website and a URL?
<br> makes a line break (no closing tag needed). A web page is one document in a browser, a website is a collection of related web pages, a URL is the address of a web resource.
State one difference between HTML and CSS, with an example of what each does.
HTML structures the content, e.g. <h1>Welcome</h1>. CSS controls how it looks, e.g. h1 { color:
blue; }.
What does CSS stand for? What is a CSS selector?
Cascading Style Sheets. A selector is the part of a CSS rule that says which HTML elements the
style applies to.
Label the parts of this rule: selector, property, value.
p {
color: blue;
}
Selector = p (which elements). Property = color (what to change). Value = blue (the new setting).
Write the line that links the style sheet style.css to an HTML page. Which part of the page does it go in?
It goes inside <head>.
<link rel="stylesheet" href="style.css">
Write a CSS rule that makes all paragraphs red with a font size of 18px.
p {
color: red;
font-size: 18px;
}
Write a CSS rule that makes every h1 blue and centred.
h1 {
color: blue;
text-align: center;
}
Write a CSS rule that makes h2 aqua, centred and in the Arial font.
h2 {
color: aqua;
text-align: center;
font-family: Arial;
}
Name the CSS property that changes: (a) text colour (b) text size (c) font (d) underline (e) space between letters
(f) shadow behind text (g) alignment.
(a) color (b) font-size (c) font-family (d) text-decoration (e) letter-spacing (f) text-shadow (g)
text-align.
Write a CSS rule that gives the whole page a light blue background.
The background colour of the page is set on the body.
body {
background-color: lightblue;
}
What do these properties do: width, height, margin, float, border-radius?
width and height set the size. margin sets the space around an element. float: left pushes an element
to the left so other content wraps beside it. border-radius rounds the corners.
Write CSS for img: width 200px, a 2px solid black border, rounded corners, floated to the left.
img {
width: 200px;
border: 2px solid black;
border-radius: 10px;
float: left;
}
What is a CSS class? How do you add one to an HTML element?
A class lets you group elements to style them the same way. Add it with the class attribute, e.g. <p
class="highlight">.
Give two reasons for using classes.
Control: the same tag can look different (red warning, green success). Speed: write the rule once
and reuse it. Easy changes: change a colour in one place instead of every page.
Write an HTML paragraph with the class warning and the text 'Careful!', and the CSS rule that makes the class
red.
The class selector starts with a dot.
<p class="warning">Careful!</p>
/* CSS */
.warning {
color: red;
}
Two paragraphs use the classes success and warning. Write the CSS so success is green and warning is red.
Why can two <p> elements look different?
They have different classes, so different rules are applied.
.success { color: green; }
.warning { color: red; }
Find and fix the error in this CSS for <p class="notice">.
notice { color: red; }
The dot is missing: a class selector must begin with a dot.
.notice { color: red; }
What is a pseudo-class? Give one example.
A pseudo-class styles an element in a particular state, e.g. a:hover changes a link when the mouse
is over it.
Write CSS that turns a link red when the mouse pointer is over it.
a:hover {
color: red;
}
List the four link pseudo-classes in the correct order and say what each does.
a:link (unvisited link), a:visited (link already clicked), a:hover (mouse is over it), a:active (while being
clicked). Order: link, visited, hover, active.
Write CSS so links are blue normally, purple after being visited and red on hover.
a:link { color: blue; }
a:visited { color: purple; }
a:hover { color: red; }
What is a <div>? Why give it a class?
A <div> is an invisible container (a toy box) used to group elements together. The class is the label
that lets CSS style that group.
Write CSS that lines up the items inside the class .menu in a row, centred across and up-and-down.
.menu {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
What is the difference between justify-content and align-items?
justify-content moves the items horizontally (left/right). align-items moves them vertically (up/down).
Create: Write the HTML and CSS for a navigation bar with three links (Home, About, Contact) in a <div> with
the class nav, laid out in a row.
<div class="nav">
<a href="index.html">Home</a>
<a href="about.html">About</a>
<a href="contact.html">Contact</a>
</div>
/* CSS */
.nav {
display: flex;
justify-content: center;
}
What is a program? Why does the order (sequence) of instructions matter?
A program is a set of instructions that a computer follows. The computer runs them in order, so a
different order can give a different result.
What is a syntax error? How do you fix errors in a program?
A syntax error happens when code breaks the rules of the programming language, e.g. a missing
quote or bracket. You fix errors by debugging: finding and correcting them.
Write two lines: a light blue background and the text 'Welcome to Game Lab!' at x = 50, y = 100.
background("lightblue");
text("Welcome to Game Lab!", 50, 100);
Where is (0, 0) in Game Lab? Which way do x and y increase?
(0, 0) is the top-left corner. x increases to the right and y increases downward.
Which point is nearer the top of the screen: (200, 30) or (200, 300)? Which is nearer the left: (20, 150) or (300,150)?
(200, 30) is nearer the top because a smaller y is higher up. (20, 150) is nearer the left because a smaller x is further left.
What is a parameter? What do the four parameters in rect(x, y, width, height) mean?
A parameter is a value supplied to a function to control its output. x and y are the position (top-left
corner), then the width and the height of the rectangle.
Write code that draws a rectangle at x = 40, y = 50 with width 100 and height 60.
rect(40, 50, 100, 60);
Write code to fill shapes red and draw a rectangle at x = 60, y = 40 with width 100 and height 50.
fill() sets the colour of the shapes drawn after it.
fill("red");
rect(60, 40, 100, 50);
What does ellipse(200, 100, 50, 50); draw? Why is it a circle?
It draws an ellipse centred at (200, 100). The width and height are both 50, so it is a circle.
Find and fix the errors: (a) background(lightblue); (b) elipse(200, 100, 50, 50);
(a) The colour needs quotes: background("lightblue"); (b) The function is spelt ellipse(200, 100, 50,
50);
Study-guide extra: What does line(x1, y1, x2, y2) do?
It draws a line between the two points (x1, y1) and (x2, y2).
Create: Write code for a sunny scene: sky-blue background, a yellow circle sun, and a green rectangle for the ground.
Any correct order, as long as the background is first.
background("skyblue");
fill("yellow");
ellipse(320, 60, 60, 60);
fill("green");
rect(0, 330, 400, 70);
What is a variable? Write one that stores a score of 10 and then changes it to 15.
A variable is a named place to store a value, and the value can change while the program runs.
var score = 10;
score = 15;
Give an example of a number, a string (text) and a boolean variable.
Number: var age = 16; String: var name = "Sam"; Boolean: var playing = true;
What is a sprite?
A character or object on the screen with properties that describe its location, movement and look.
Explain what each part means: createSprite(200, 200), player, setAnimation("player"), drawSprites().
var player = createSprite(200, 200);
player.setAnimation("player");
drawSprites();
createSprite(200, 200) makes a sprite at (200, 200). player is the variable that refers to the sprite.
setAnimation("player") gives it an image. drawSprites() displays the sprites on the screen.
Write three lines that create a sprite called player at (200, 200), give it the animation "player" and display it.
var player = createSprite(200, 200);
player.setAnimation("player");
drawSprites();
What is the difference between a sprite and an animation? Where must the animation name exist?
The sprite is the game object; the animation supplies the image(s) it shows. The name must match an animation in the project’s Animation tab.
A sprite does not appear on the screen. Give two possible causes.
drawSprites() was not called, or the animation name does not match one in the Animation tab (also: wrong position, or visible set to false).
Name five sprite properties and say what two of them control.
x, y, scale, rotation, visible, velocityX, velocityY. x = horizontal position, y = vertical position, scale = size, rotation = angle, visible = shown or hidden, velocityX/velocityY = movement speed.
Write code to move the sprite player to x = 150, y = 100 and make it twice as big.
Use the sprite name, a dot, then the property.
player.x = 150;
player.y = 100;
player.scale = 2;