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:
weightKg) of the laptop L1 and the laptop L2modelName) of the lightest laptop"Equal" if the laptops are the same weight.The algorithm should work for any values stored in L1 and L2.
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.