Skip to content

Course home

Programming fundamentals

Programming fundamentals

EasyMediumHard
123456789101112131415161718192021222324
Question 1

A cloud hosting provider offers two types of virtual machine instances:

  • A "General" instance costs $0.12 per hour.
  • A "Compute" instance costs $0.24 per hour.

Create a function, calculateComputeCost(), that takes the number of hours and the instance type as parameters, then calculates and returns the total billing cost.

You do not have to validate these parameters.

You must use either:

  • OCR Exam Reference Language, or
  • a high-level programming language that you have studied.
[4]
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