The worksheetDownload the PDF
Answers

F12.9 Project: an impact report

Technology and society · GCSE · OCR J277 1.6.1, AQA 8525 3.8, Edexcel 1CP2 5.1.1 · about 25 min

BugBotLab

What this lesson is about

Read the trial log, anonymise it, cost its energy and carbon, and publish a report.

Questions 5 marks in all

  1. [1 mark]Why does the report use "student 1" instead of names?

    1. ASo it holds no personal data and can be shared safely
    2. BTo make it shorter
    3. CBecause names are hard to print
    4. DTo save electricity
    Answer: A. It keeps the useful pattern without identifying anyone.
  2. [1 mark]Which impacts does the report cover?

    1. APrivacy and the environment
    2. BOnly cost
    3. COnly privacy
    4. DOnly performance
    Answer: A. It anonymises the data and costs the energy and carbon.
  3. [1 mark]170 minutes of a 60 W device. How many kWh?

    Answer: 0.17. 60 × (170 ÷ 60) ÷ 1000 = 0.17.
  4. [1 mark]Anonymised data can sometimes still identify someone. How?

    1. ABy joining it with other data
    2. BBy reading it twice
    3. CBy compressing it
    4. DBy encrypting it
    Answer: A. A record of one person's exact route home is still that person.
  5. [1 mark]What makes a good conclusion to an impact report?

    1. AA judgement supported by the impacts you found
    2. BA list of every fact
    3. COnly the good news
    4. DNo conclusion at all
    Answer: A. Discuss and evaluate questions expect a supported judgement.

The task: write the report

Read trial.csv and print the report, in this order and these exact forms: - sessions: <n> - students: <n> - total minutes: <n> - one line per student, student <n>: <minutes> min, <cm> cm, numbered in the order they first appear - energy: <kwh> kWh rounded to 2 decimal places - cost: £<n> rounded to 2 decimal places - carbon: <n> g CO2 rounded to the nearest whole number - personal data in this report: none

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

WATTS = 60
PENCE_PER_KWH = 28
GRAMS_PER_KWH = 190

The hint students can ask for: Read the file and drop the header line. Give each new name the next number and keep its running totals, so the report can talk about students without naming them. Turn the total minutes into energy, then into money and carbon with the rates given.

A solution

from bugbot import *
connect()
WATTS = 60
PENCE_PER_KWH = 28
GRAMS_PER_KWH = 190

rows = open("trial.csv").read().strip().split("\n")[1:]
numbers = {}
minutes = {}
distance = {}
total_minutes = 0
for row in rows:
    name, email, mins, cm = row.split(",")
    if name not in numbers:
        numbers[name] = len(numbers) + 1
        minutes[name] = 0
        distance[name] = 0
    minutes[name] = minutes[name] + int(mins)
    distance[name] = distance[name] + int(cm)
    total_minutes = total_minutes + int(mins)
print("sessions:", len(rows))
print("students:", len(numbers))
print("total minutes:", total_minutes)
for name, n in numbers.items():
    print(f"student {n}: {minutes[name]} min, {distance[name]} cm")
kwh = WATTS * total_minutes / 60 / 1000
print(f"energy: {kwh:.2f} kWh")
print(f"cost: £{kwh * PENCE_PER_KWH / 100:.2f}")
print(f"carbon: {round(kwh * GRAMS_PER_KWH)} g CO2")
print("personal data in this report: none")

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