ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions
4 marks · Data types and structures
Create, using pseudocode or a language with which you are familiar, a record structure to store the book details. Declare, using pseudocode or a language with which you are familiar, a variable that can store the data for 1000 books. A programmer is creating a program to store details about books. The details stored are: title, author, number of pages and price.
RECORD BookDetails IS {STRING title, STRING author, INTEGER number of pages, REAL price} 1 mark for named record structure 1 mark for all fields with correct data types Accept language specific data types eg single, currency Create variable ListOfBooks [999] of (data type) BookDetails OR DECLARE ListOfBooks AS ARRAY OF BookDetails INITIALLY [] * 999 1 mark for array with value 1 mark for data type from record created in (a)
Previous question: Higher Computing Science 2017 Question 8 (CfE)
Next question: Higher Computing Science 2017 Question 10 (CfE)