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.

2025 May-June · Paper 23 · Q6(b)

Data types and records · 5 marks · official answer ready

(b) Write the pseudocode to define the module headers: Sub_Part1A .................................................................................................................…

2025 May-June · Paper 23 · Q6(c)

Data types and records · 3 marks · official answer ready

(c) The structure chart uses the two symbols shown. Complete the table to explain what each symbol means and how the relevant modules in the structure chart are affected. Symbol E…

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

Data types and records · 5 marks · official answer ready

11 (a) A medical centre uses objects of the class Appointment to record treatments given and medication prescribed during each doctor’s appointment. Some of the attributes require…

2025 May-June · Paper 31 · Q12

Data types and records · 5 marks · official answer ready

12 The pseudocode algorithm checks whether a location in a stock file StockList.dat is empty or not. The location is given by the user. If the location is empty, a suitable messag…

2025 May-June · Paper 32 · Q1(b)(i)

Data types and records · 2 marks · official answer ready

(i) Write a pseudocode statement to declare GateID to hold the identity codes for the airport gates: ..............................................................................…

2025 May-June · Paper 32 · Q1(b)(ii)

Data types and records · 1 mark · official answer ready

(ii) Write the new pseudocode statement required to replace the declaration of Gate in Departure. .................................................................................…

2025 May-June · Paper 32 · Q12(a)

Data types and records · 5 marks · official answer ready

12 (a) A medical clinic uses objects of the class Patient to assign a priority and a doctor to a patient. Some of the attributes required in the class are listed in the table. Att…

2025 May-June · Paper 32 · Q13

Data types and records · 5 marks · official answer ready

13 The pseudocode algorithm below uses random file access to copy 50 records from a live file CurrentResults.dat to a stored file StoredResults.dat one record at a time. It uses t…

2025 May-June · Paper 33 · Q11

Data types and records · 5 marks · official answer ready

11 The pseudocode algorithm below allows a user to input a new stock item. The random file is searched for the next empty location in the file and the new item is inserted there. …

2025 May-June · Paper 33 · Q12(a)

Introduction to abstract data types · 1 mark · official answer ready

12 (a) An array is an Abstract Data Type (ADT). Identify two other ADTs. 1 ........................................................................................................…

2025 May-June · Paper 33 · Q12(b)

Arrays · 4 marks · official answer ready

(b) A 1D array DataArray holds up to 1000 elements of type integer and needs to be sorted in ascending order. Write the pseudocode for an insertion sort to sort the array into asc…

2025 May-June · Paper 41 · Q2(a)

Files · 7 marks · official answer ready

(a) The function ReadData(): • prompts the user to enter a filename and reads this filename from the user • opens the file and reads each line of data into a 1D array • returns th…

2025 May-June · Paper 41 · Q2(b)

Arrays · 6 marks · official answer ready

(b) The procedure SplitData() takes a 1D string array as a parameter with the identifier DataArray The procedure declares six 1D arrays: one array for each colour that appears in …

2025 May-June · Paper 41 · Q2(d)

Arrays · 2 marks · official answer ready

(d) Each of the six colours has a blank text file where the numbers will be stored. The names of these six text files are: • Blue.txt • Green.txt • Orange.txt • Pink.txt • Red.txt…

2025 May-June · Paper 41 · Q2(e)(i)

Files · 3 marks · official answer ready

(i) Write program code for the main program. Save your program. Copy and paste the program code into part 2(e)(i) in the evidence document. [3]

2025 May-June · Paper 42 · Q2(b)(i)

Arrays · 12 marks · official answer ready

(i) Write program code to declare the global arrays HashTable and Spare Save your program. Copy and paste the program code into part 2(b)(i) in the evidence document. [1]

2025 May-June · Paper 42 · Q2(b)(ii)

Data types and records · 13 marks · official answer ready

(ii) An empty record has the integer –1 stored in each field. The procedure Initialise() stores an empty record in each element in HashTable and Spare Write program code for Initi…

2025 May-June · Paper 42 · Q2(e)

Data types and records · 16 marks · official answer ready

(e) The text file HashData.txt stores up to 200 rows of data to be stored into the hash table. Each row contains three integer numbers separated by commas. The first number is the…

2025 May-June · Paper 42 · Q2(f)(ii)

Arrays · 12 marks · official answer ready

(ii) The main program should call the procedure to initialise the arrays, call the procedure to create the hash table and then call the procedure to output the contents of the arr…

2025 May-June · Paper 43 · Q1(e)(ii)

Arrays · 1 mark · official answer ready

(ii) Test your program. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into part 1(e)(ii) in the evidence document. [1] 4