The worksheetDownload the PDF
Answers

F9.7 Secondary storage

Logic and computer systems · GCSE · OCR J277 1.2.2, AQA 8525 3.4.5, Edexcel 1CP2 3.1.2 · about 15 min

BugBotLab

What this lesson is about

Magnetic, optical, solid state and cloud storage, and choosing between them.

Questions 6 marks in all

  1. [1 mark]Why do computers need secondary storage?

    1. AIt keeps programs and files when the power is off
    2. BIt is faster than RAM
    3. CThe CPU runs programs directly from it
    4. DIt holds the boot program
    Answer: A. Secondary storage is non-volatile.
  2. [1 mark]Which storage suits a robot that vibrates across a mat?

    1. ASolid state, because it has no moving parts
    2. BA hard disk, because it has high capacity
    3. COptical, because discs are cheap
    4. DMagnetic tape, because it is reliable
    Answer: A. Durability matters most: a spinning disk could be damaged.
  3. [1 mark]How does optical storage read data?

    1. AA laser reads pits and flat areas on a disc
    2. BA head reads magnetised areas
    3. CElectrical charges are read from chips
    4. DA camera photographs the disc
    Answer: A. CDs, DVDs and Blu-ray are optical.
  4. [1 mark]What is an advantage of a hard disk over an SSD?

    1. ALower cost per gigabyte
    2. BFaster access
    3. CNo moving parts
    4. DLighter
    Answer: A. Hard disks are cheap for large capacities.
  5. [1 mark]What is a drawback of cloud storage?

    1. AIt needs an internet connection
    2. BFiles cannot be shared
    3. CIt cannot be reached from a phone
    4. DIt has a fixed, small capacity
    Answer: A. No connection, no files; the data is also held by another company.
  6. [1 mark]Copying a 3000 MB file at 150 MB per second takes how many seconds?

    Answer: 20. 3000 ÷ 150.

The task: the storage chooser

Write choose(needed_gb, no_moving_parts). It returns the name of the cheapest device in devices whose capacity is at least needed_gb, and which has no moving parts if no_moving_parts is True. A device's price in pence is its capacity times its pence per GB. Print one line for each job in jobs, in the form robot logs: SD card.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

# name, capacity in GB, pence per GB, has moving parts
devices = [
    ("hard disk", 2000, 2, True),
    ("SSD", 1000, 6, False),
    ("SD card", 256, 10, False),
    ("Blu-ray", 50, 4, True),
]
# job, GB needed, needs no moving parts
jobs = [("robot logs", 64, True), ("school backups", 1500, False), ("video editing", 500, True), ("film archive", 40, False)]

The hint students can ask for: Look at every device and skip the ones that are too small or that have moving parts when the job forbids them. Of those left, keep the one whose price, its capacity times its price per gigabyte, is lowest.

A solution

from bugbot import *
connect()
devices = [
    ("hard disk", 2000, 2, True),
    ("SSD", 1000, 6, False),
    ("SD card", 256, 10, False),
    ("Blu-ray", 50, 4, True),
]
jobs = [("robot logs", 64, True), ("school backups", 1500, False), ("video editing", 500, True), ("film archive", 40, False)]

def choose(needed_gb, no_moving_parts):
    best = None
    best_price = 0
    for name, capacity, pence, moving in devices:
        if capacity < needed_gb or (no_moving_parts and moving):
            continue
        price = capacity * pence
        if best is None or price < best_price:
            best = name
            best_price = price
    return best

for job, gb, still in jobs:
    print(f"{job}: {choose(gb, still)}")

Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.