Computer Science For First Examination In 2021 9618 · 10

Data types and structures

223 questions. Open a question to solve it and check the official answer.

2023 October-November · Paper 32 · Q19(c)

Data types and records · 13 marks

(c) N is a person who might enjoy H if H is a hobby and N does not dislike H. Write this as a rule. might_enjoy(N, H) IF ..........................................................…

2023 October-November · Paper 33 · Q8

Data types and records · 8 marks

8 (a) A pseudocode algorithm finds a customer account record in a random file and outputs it. The records are stored using the user-defined data type TAccount. TYPE TAccount DECLA…

2023 October-November · Paper 33 · Q8(a)

Data types and records · 5 marks · official answer ready

8 (a) A pseudocode algorithm finds a customer account record in a random file and outputs it. The records are stored using the user-defined data type TAccount. TYPE TAccount DECLA…

2023 October-November · Paper 33 · Q10

Introduction to abstract data types · 10 marks

10 A stack is to be set up using the information in the table. Identifier Data type Description BasePointer INTEGER points to the bottom of the stack TopPointer INTEGER points to …

2023 October-November · Paper 33 · Q10(a)

Data types and records · 3 marks · official answer ready

10 A stack is to be set up using the information in the table. Identifier Data type Description BasePointer INTEGER points to the bottom of the stack TopPointer INTEGER points to …

2023 October-November · Paper 33 · Q10(c)

Introduction to abstract data types · 2 marks · official answer ready

10 A stack is to be set up using the information in the table. Identifier Data type Description BasePointer INTEGER points to the bottom of the stack TopPointer INTEGER points to …

2023 October-November · Paper 41 · Q2(c)(iii)

Data types and records · 5 marks · official answer ready

(iii) The pseudocode algorithm for the procedure TotalData(): • uses Dequeue() to remove an ID from the queue • checks whether a RecordData with the returned ID exists in Records …

2023 May-June · Paper 11 · Q2(b)(iii)

Data types and records · 4 marks · official answer ready

(iii) Part of the database table BIRD_TYPE is shown: BirdID Name Size 0123 Blackbird Medium 0035 Jay Large 0004 Raven Large 0085 Robin Small The database only supports these data …

2023 May-June · Paper 11 · Q3(c)

Files · 3 marks · official answer ready

(c) The Operating System has utility software including defragmentation software. Explain how defragmentation can improve the performance of the computer. ........................…

2023 May-June · Paper 21 · Q4(b)

Data types and records · 23 marks

(b) A different part of the program uses the variable StartDate. Write pseudocode statements to declare StartDate and assign to it the date corresponding to 15/11/2005. Declaratio…

2023 May-June · Paper 21 · Q7(b)(ii)

Data types and records · 3 marks · official answer ready

(ii) Two new modules are added: Module‑X() and Module‑Y(). • Module‑X() has no parameters. • Module‑Y() will take a string and a real number as parameters and return a Boolean val…

2023 May-June · Paper 21 · Q8(a)

Data types and records · 7 marks · official answer ready

(a) Write pseudocode for module IsNewSupp(). Module SuppExists() has already been written and should be used as part of your solution. Module SuppExists() will generate a run-time…

2023 May-June · Paper 22 · Q1(c)

Data types and records · 3 marks · official answer ready

(c) Give the appropriate data types for the following variables: ValidAddress .....................................................................................................…

2023 May-June · Paper 22 · Q3(a)

Introduction to abstract data types · 0 marks

(a) The diagram below represents an Abstract Data Type (ADT) implementation of the queue. Each data item is stored in a separate location in the data structure. During initial des…

2023 May-June · Paper 23 · Q1(a)

Arrays · 3 marks · official answer ready

(a) The pseudocode contains references to an array. Complete the table by writing the answer for each row. Answer The dimension of the array The name of the variable used as an ar…

2023 May-June · Paper 23 · Q4

Data types and records · 6 marks · official answer ready

4 A function MakeString() will: 1. take two parameters: • a count as an integer • a character 2. generate a string of length equal to the count, made up of the character 3. return…

2023 May-June · Paper 23 · Q7(b)

Data types and records · 3 marks · official answer ready

(b) Part of the library program contains program modules with headers as follows: Pseudocode module header PROCEDURE Module-X() PROCEDURE Module-Y(BYREF RA : INTEGER, SA : REAL) P…

2023 May-June · Paper 31 · Q3(a)

Data types and records · 2 marks · official answer ready

3 (a) A hashing algorithm is used to calculate storage locations for records in a random access file. It calculates hash values by using the function modulus 3. The function modul…

2023 May-June · Paper 31 · Q11(a)

Introduction to abstract data types · 3 marks · official answer ready

(a) Write the pseudocode to declare MaxSize, FrontPointer, RearPointer, Length and Queue. .........................................................................................…

2023 May-June · Paper 31 · Q11(c)

Introduction to abstract data types · 4 marks · official answer ready

(c) Explain how a new element can be added to the queue if it is implemented using two stacks. ....................................................................................…