Skip to content

Course home

Programming fundamentals

Programming fundamentals

EasyMediumHard
123
Question 2

Apex Heating Systems need to identify the total duration in minutes that the heating zones have been active on a specific date.

The data from the database table heating_log is imported into a program written in a high-level programming language.

The program stores the data in a two-dimensional (2D) string array with the identifier logData.

The data to be stored is shown in the table below:

DateZoneIDZoneTypeDuration
12/11/2024ZH1Hall45
12/11/2024ZK2Kitchen15
13/11/2024ZB1Bedroom60
13/11/2024ZH1Hall30
14/11/2024ZK1Kitchen20
14/11/2024ZB2Bedroom45
14/11/2024ZH1Hall15

In this table, the value of logData[1, 1] contains "ZK2".

Write a program that:

  • asks the user to input a date
  • totals the active duration (in minutes) for the date input
  • outputs the calculated total in an appropriate message including the date, for example:

The heating was active for 60 minutes on 12/11/2024

You must use either:

  • OCR Exam Reference Language, or
  • A high-level programming language that you have studied.
[6]
Markscheme

Programming fundamentals Questions

  1. GCSE
  2. /Computer Science
  3. /Programming fundamentals

95 exam-style questions on OCR GCSE Computer Science Programming fundamentals. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank