Skip to content

Course home

Representing algorithms

Representing algorithms

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
Question 73

An algorithm uses the following record structure to store laptop specifications:

RECORD Laptop
    modelName : String
    brand : String
    weightKg : Real
ENDRECORD

L1 ← Laptop("ZenBook 14", "Asus", 1.15)
L2 ← Laptop("MacBook Air", "Apple", 1.29)

Write an algorithm using pseudo-code to display the model name of the lightest laptop.

The algorithm should:

  • compare the weight (weightKg) of the laptop L1 and the laptop L2
  • output the model name (modelName) of the lightest laptop
  • output the string "Equal" if the laptops are the same weight.

The algorithm should work for any values stored in L1 and L2.

[3]
Markscheme

Representing algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Representing algorithms

208 exam-style questions on AQA GCSE Computer Science Representing algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank