Question 1
2 marksDid your answer earn the marks?
24 original exam-style questions - 10 pages of questions with a full mark scheme - free printable PDF.
| Description | Type of utility software |
|---|---|
| 1) Reorganises files stored on a hard disk drive so that fragmented parts of a file are stored closer together, reducing the time taken to access them. | ? |
| 2) Scrambles data using an algorithm and a key so that it cannot be understood if it is intercepted. | ? |
| 3) Reduces the size of a file so that it takes up less storage space or can be transferred more quickly. | ? |
tasks <- [6, 3, 5]
timeSlice <- 2
round <- 0
WHILE tasks[0] > 0 OR tasks[1] > 0 OR tasks[2] > 0
round <- round + 1
FOR i <- 0 TO 2
IF tasks[i] > 0 THEN
IF tasks[i] >= timeSlice THEN
tasks[i] <- tasks[i] - timeSlice
ELSE
tasks[i] <- 0
ENDIF
ENDIF
NEXT i
OUTPUT round, tasks[0], tasks[1], tasks[2]
ENDWHILE| Round | tasks[0] | tasks[1] | tasks[2] |
|---|---|---|---|
| 1 | ? | ? | ? |
| 2 | ? | ? | ? |
| 3 | ? | ? | ? |
frames <- ["-", "-", "-"]
pageRefs <- [1, 2, 3, 1, 4, 1]
FOR i <- 1 TO 6
page <- pageRefs[i]
IF page NOT IN frames THEN
FOR j <- 1 TO 2
frames[j] <- frames[j + 1]
NEXT j
frames[3] <- page
ENDIF
OUTPUT i, frames[1], frames[2], frames[3]
NEXT i| i | frames[1] | frames[2] | frames[3] |
|---|---|---|---|
| 1 | ? | ? | ? |
| 2 | ? | ? | ? |
| 3 | ? | ? | ? |
| 4 | ? | ? | ? |
| 5 | ? | ? | ? |
| 6 | 3 | 4 | 1 |
INPUT text
count <- 1
result <- ""
FOR i <- 1 TO LEN(text) - 1
IF MID(text, i, 1) = MID(text, i + 1, 1) THEN
count <- count + 1
ELSE
result <- result + MID(text, i, 1) + STR(count)
count <- 1
ENDIF
NEXT i
result <- result + MID(text, LEN(text), 1) + STR(count)
OUTPUT resultThis checks your answers in your browser, stores nothing on a server and needs no account.