Learn Extracted exam questions IGCSE Computer Science 0478_w23_qp_21
0478_w23_qp_21
Source PDF on the left, extracted YAML on the right. Compare numbering, marks, options and text.
5 The first stage of the program development life cycle is analysis. Two of the tasks in analysis are abstraction and decomposition.
(a) Describe what is meant by abstraction [2]
(b) Identify three of the component parts when a problem has been decomposed at the analysis stage. 1 2 3 [3]
(c) Identify and describe one other stage of the program development life cycle [2]
2 Tick (3) one box to show how a value can be passed to a procedure. A function B parameter C return D subroutine
[1]
3 Four descriptions of data and five data types are shown.
Draw one line to link each description to the most appropriate data type.
Not all data types will be used.
Description
Data type a whole number a single letter a word or phrase a number with two decimal places BOOLEAN CHAR INTEGER REAL STRING
[4]
6 An algorithm has been written in pseudocode.
01 DECLARE A[1:10] : STRING
02 DECLARE T : STRING
03 DECLARE C, L : INTEGER
04 L 10
05 FOR C 1 TO L
06 OUTPUT "Please enter name "
07 INPUT A[C]
08 NEXT C
09 FOR C 1 TO L
10 FOR L 1 TO 9
11 IF A[L] > A[L + 1]
12 THEN
13 T A[L]
14 A[L] A[L + 1]
15 A[L + 1] T
16 ENDIF
17 NEXT L
18 NEXT C
19 FOR C 1 TO L
20 OUTPUT "Name ", C, " is ", A[C]
21 NEXT C
(a) State the purpose of this pseudocode algorithm [1]
(b) State four processes in this algorithm. 1 2 3 4 [4]
(c) Meaningful identifiers have not been used in this algorithm.
Suggest suitable meaningful identifiers for:
The array: A The variables: T C L [3]
(d) State two other ways the algorithm can be made easier to understand and maintain. 1 2 [2]
1 Tick (3) one box to show which operator means less than or equal to. A OR B <
C <= D
=
[1]
4 Circle the three words representing places where data may be stored. array constant dimension input output procedure variable
[3]
7 Consider this logic circuit. A B X C
(a) Write a logic expression for this logic circuit. Do not attempt to simplify this logic expression. X = [4]
(b) Complete the truth table from the given logic circuit. A B C Working space X 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1
[4]
8 A programmer is designing an algorithm to calculate the cost of a length of rope.
The program requirements are: • input two values: the length of rope in metres Length and the cost of one metre Cost • perform a validation check on the length to ensure that the value is between 0.5 and 6.0 inclusive • calculate the price Price • output the price rounded to two decimal places.
Use the variable names given.
(a) State the name of the validation check [1]
(b) Complete the flowchart for this algorithm. START STOP [6]
(c) Give two different sets of test data for this algorithm and state the purpose of each set. Set 1 Purpose Set 2 Purpose [4]
(d) Complete the headings for the trace table to show a dry-run for this algorithm.
You do not need to trace the algorithm [3]
(e) Describe an improvement that should be made to the requirements for this algorithm [2]
9 A model shop wants to set up a database to help with stock control of the model figures available for sale. The shop wants to store this information about the model figures:
Field 1 – catalogue number, for example MD1234
Field 2 – description, for example ‘small white dog’
Field 3 – number in stock, for example 5
Field 4 – the price of each model, for example 7.40
Field 5 – if the model has already been painted, yes or no.
(a) The shop needs five fields for each record.
Give a suitable name and data type for each field. Field 1 name Data type Field 2 name Data type Field 3 name Data type Field 4 name Data type Field 5 name Data type [5]
(b) (i) Give the name of the field that should be used for the primary key [1]
(ii) State why this field is used as the primary key [1]
(c) Structured query language (SQL) is used to query data stored in this database.
State what these SQL commands are used for. SELECT FROM WHERE [3]