Software behind the screen
Answers are for parents and teachers.
1
A phone has 10 blocks of RAM. A map program uses 4 blocks and a chat program uses 3. A camera program needs 5 blocks. (a) How many blocks are free? (b) Can the camera program start? (c) Which program could be closed so that it can?
(a) 10 − (4 + 3) = 3 blocks. (b) No, 5 is more than 3. (c) Closing the map program frees 4 blocks, so 3 + 4 = 7 blocks are free, which is enough. Closing the chat program gives only 3 + 3 = 6, which is also enough.
2
A tablet runs this program. Predict the output for the inputs 1, 2 and 12.
Python
1idle = int(input("Minutes idle: ")) 2if idle < 2: 3 print("Stay awake") 4elif idle < 10: 5 print("Dim the screen") 6else: 7 print("Sleep")
Input 1: Stay awake. Input 2: Dim the screen (2 < 2 is false, 2 < 10 is true). Input 12: Sleep (12 < 10 is false).
3
A disk of 8 cells holds file M (3 cells) and file N (2 cells) side by side from the first cell, then 3 free cells. M is deleted. A new file O needs 4 cells. Draw the strip after saving O and say how many pieces O is in.
After saving M and N: M M M N N . . . After deleting M: . . . N N . . . File O needs 4 cells, so it takes cells 1–3 and then cell 6: O O O N N O . . File O is in 2 pieces.
4
Explain to a younger child, in three or four sentences, what a device driver does. Use an example of your own, not a travel plug adapter.
Model answer: A device driver is a small program made for one device. Think of a remote control made for one television: its buttons send codes that only that television understands. In the same way the driver turns the computer’s commands into the exact signals one printer, for example, understands, and turns the printer’s replies back.
5
Make a table with two columns, compiler and interpreter. Write two differences between them. Then say which you would choose for a program you are still writing and testing, and why.
Model answer: Compiler: translates the whole program at once; makes an executable file that runs without the compiler. Interpreter: translates one line at a time; needs the interpreter every time the program is run. For a program that is still being tested, an interpreter is useful because it runs straight away after each change and stops at the line that has the error.