Data types and structures
283 questions. Open a question to solve it and check the official answer.
Data types and records · 2 marks · official answer ready
(i) A run-time error could occur when the function is used. Name and describe one other type of error that the function could contain. Name .......................................…
Data types and records · 1 mark · official answer ready
(i) Identify two values that could be replaced by constants in the function GetDiscountRate(). ....................................................................................…
Data types and records · 2 marks · official answer ready
(ii) Write pseudocode to declare one of the constants you have given in part (c)(i). ..............................................................................................…
Data types and records · 1 mark · official answer ready
(iv) Give a reason why the use of library routines helps to minimise the risk of errors when writing a program. ...................................................................…
Data types and records · 2 marks · official answer ready
(v) Constants and library routines help to minimise the risk of errors. Name another way that you can minimise the risk of errors when writing a program. Explain how this helps. N…
Data types and records · 10 marks
5 A program collects data about the performance of a car at regular time intervals. A text file, CarStatus.txt, stores the data. The format of each line of the text file is as fol…
Data types and records · 5 marks · official answer ready
(i) The following table contains statements written in pseudocode. Give the most appropriate data type for the variable used in each statement. Statement Data type Revision 'B' Ma…
Data types and records · 5 marks · official answer ready
(ii) The value of the total amount spent is calculated by an Electronic Point Of Sale (EPOS) system. This system does not have the prices of all items. For these items, a valid to…
Data types and records · 11 marks · official answer ready
5 The procedure LineNumber() will: • read data from a text file • modify each line by adding a line number, and the string (": ") • output each modified line. For example, when th…
Data types and records · 5 marks · official answer ready
(i) The following table contains statements written in pseudocode. Give the most appropriate data type for the variable used in each statement. Statement Data type Revision 500 Fu…
Data types and records · 6 marks · official answer ready
(ii) The function GetCardNumber() prompts the user to input a card number until the number input is valid. A valid card number has 16 characters. Each character is a numeric chara…
Data types and records · 4 marks · official answer ready
(ii) The function CalcBonus() is tested using white-box testing. State two different pairs of values for Spend and Points that can be used to test different paths through the func…
Data types and records · 4 marks · official answer ready
(c) Name two types of program maintenance and state the reason why each is needed. Name ...........................................................................................…
Data types and records · 5 marks · official answer ready
(i) Examine the pseudocode and complete the following table. Answer The name of a global identifier The name of a user-defined procedure The scope of ArrayIndex The number of dime…
Data types and records · 4 marks · official answer ready
(ii) Describe in detail, the purpose of lines 107 to 114 in the Update() function. Do not use pseudocode in your answer. ..........................................................…
Data types and records · 2 marks · official answer ready
(c) The function Update() is an example of a module within a program. Describe the mechanism that supports the transfer of values between modules. ................................…
Data types and records · 3 marks · official answer ready
(i) CharArray is a 1D array of type CHAR. It contains 200 elements. Write program code to change all the numeric characters ('0' to '9') in CharArray to '*'. Programming language …
Data types and records · 10 marks · official answer ready
5 The function ReadFileLine() returns a specific line from a text file. The function takes two parameters: Identifier Data type Description FileName STRING The name of the text fi…
Data types and records · 1 mark
(a) Name the data type of Book. ...............................................................................................................................................[1]
Data types and records · 1 mark · official answer ready
(b) Name the non‑composite data type used in the Supplier declaration. ............................................................................................................…
