IGCSE Computer Science 0478 Paper 22, Oct/Nov 2023

Question paper and mark scheme75 marks10 questions

Solve it on ExamPal

Practise

Untimed. Write on the paper and check as you go.

Start

Exam

Timed, with a clock you set, like sitting the real paper.

Start

Opens full screen.

Papers open in

Opening the question paper

Read as textThe questions and the mark scheme as plain text. Easier to read on a phone.

Question paper

0478/22 · Oct/Nov 2023

Download PDF
2

A type of validation check is a length check. Another type of validation check is used to make sure that any date entered is in the dd/mm/yyyy style: dd means day, mm means month and yyyy means year.

a

State the type of validation check used.

[1]
b

Give one example of normal test data and one example of abnormal test data you should use to make sure the check in part (a) is working properly. State a reason for each of your choices of test data. Normal ...................................................................................................................................... Reason ..................................................................................................................................... ................................................................................................................................................... Abnormal .................................................................................................................................. Reason ..................................................................................................................................... ...................................................................................................................................................

[4]
c

Describe how a length check could be used with the date entered.

[2]
3

Four pseudocode statements and five pseudocode uses are shown.

Figure 1 of 3 for question 3
Figure 2 of 3 for question 3
Figure 3 of 3 for question 3
a

Draw one line to link each pseudocode statement to the most appropriate pseudocode use. Not all pseudocode uses will be required.

[4]
b

A one-dimensional (1D) array called Temperatures[] has 25 elements beginning at index 1. It holds values that range between –20 and 100 inclusive. Write a pseudocode algorithm using a single loop to find the lowest value in this array and output the result only once. You do not need to declare or populate this array.

[4]
4

An algorithm has been written in pseudocode to allow the names of 50 cities and their countries to be entered and stored in a two-dimensional (2D) array. The contents of the array are then output. 01 DECLARE City ARRAY[1:50, 1:2] OF BOOLEAN 02 DECLARE Count : INTEGER 03 DECLARE Out : INTEGER 04 Count ← 1 05 IF 06 OUTPUT "Enter the name of the city" 07 INPUT City[Count, 2] 08 OUTPUT "Enter the name of the country" 09 INPUT City[Count, 2] 10 Count ← Count + 1 11 UNTIL Count = 50 12 FOR Out ← 1 TO 1 13 OUTPUT "The city ", City[Out, 1], " is in ", City[Out, 2] 14 NEXT Out

a

Identify the four errors in the pseudocode and suggest corrections. Error 1 ....................................................................................................................................... Correction ................................................................................................................................. ................................................................................................................................................... Error 2 ....................................................................................................................................... Correction ................................................................................................................................. ................................................................................................................................................... Error 3 ....................................................................................................................................... Correction ................................................................................................................................. ................................................................................................................................................... Error 4 ....................................................................................................................................... Correction ................................................................................................................................. ...................................................................................................................................................

[4]
b

Describe the changes you should make to the corrected algorithm to allow the name of a country to be input and to display only the stored cities from that country. You do not need to rewrite the algorithm.

[5]
5

Explain how variables and constants should be used when creating and running a program.

[3]
6

The flowchart represents an algorithm that performs a process on groups of values that are input. The algorithm will fail if the first value of any group is 0. An input of –1 will terminate the algorithm.

Figure 1 of 1 for question 6
a

Complete the trace table for the input data: 25, 35, 3, 0, 57, 20, 25, 18, 0, –1, 307, 40, 0

[5]
b

Describe the purpose of the algorithm.

[2]
7

The string operation SUBSTRING(Quote, Start, Number) returns a string from Quote beginning at position Start that is Number characters long. The first character in Quote is in position 1. Write pseudocode statements to: • store the string "Learning Never Exhausts The Mind" in Quote • extract and display the words "The Mind" from the string • output the original string in lower case.

[5]
8

Explain why a programmer would use procedures and parameters when writing a program.

[4]
9

Consider the logic expression: Z = (A NAND B) OR NOT (B XOR C)

a

Draw a logic circuit for this logic expression. Each logic gate must have a maximum of two inputs. Do not simplify this logic expression.

[4]
b

Complete the truth table from the given logic expression.

[4]
10

A database table called Horses stores details about the horses kept at a horse sanctuary.

a

State the number of records in this database table.

[1]
b

Give the name of the field that is most suitable to be the primary key. State the reason for this choice. Field .......................................................................................................................................... Reason ..................................................................................................................................... ...................................................................................................................................................

[2]
c

The database only allows the data types: • Boolean • character • date/time • integer • real • text. Complete the table to show the most appropriate data type for each field. Each data type must be different.

[2]
d

Complete the structured query language (SQL) to return the code and breed of all the horses whose breed originated in Scotland. ......................................... Code, Breed, FROM ......................................... WHERE ......................................... = "Scotland";

[3]
11

A wood flooring company stores the names of up to 100 customers in a one-dimensional (1D) array Customers[]. A two-dimensional (2D) array Quotations[] stores details of each customer’s quotation: • length of room (one decimal place) • width of room (one decimal place) • area of wood required (rounded up to next whole number) • choice of wood index (whole number) • price of wood required in dollars (two decimal places). The floor measurements (room length and room width) are taken in metres. All floors are rectangles and room measurements must be between 1.5 and 10.0 inclusive. The index of any customer’s data is the same in both arrays. For example, a customer named in index 4 of Customers[] corresponds to the data in index 4 of Quotations[] The wood choices available are: Index | Wood type | Price per square metre ($) 1 | Laminate | 29.99 2 | Pine | 39.99 3 | Oak | 54.99 The data are stored in two 1D arrays named WoodType[] and Price[]. The index of the wood type and price in their arrays share the same index number. Write a program that meets the following requirements: • input a new customer’s name, room length and room width • check that each measurement is valid • output an error message and require the measurement to be re-entered until it is valid • calculate the area of the room by multiplying together the length of the room and the width of the room • input the choice of wood and find its price per square metre • calculate the price of the wood needed • store all data in the relevant array • output the customer’s quotation to include: the name of the customer, the choice of wood and the calculated price of the wood required • continue to accept the next customer. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays or variables; you may assume that this has already been done. You will need to initialise WoodType[] and Price[] All inputs and outputs must contain suitable messages.

[15]

Mark scheme

0478/22 · Oct/Nov 2023

Download PDF

2a · 1 mark

  • 1 mark

    Format check

2b · 4 marks

  • 1 mark

    Normal test data: Normal – 30/12/1960 …

  • 1 mark

    Reason – … (the date is written in the correct format and) should be accepted.

  • 1 mark

    Abnormal test data: Abnormal – 30/Dec/1960 …

  • 1 mark

    Reason – … (the month is not written in the correct format and) should be rejected.

2c · 2 marks

  • 1 mark

    check that there are 10 characters in total

  • 1 mark

    if the date is too long/short it will be rejected

3a · 4 marks

  • 1 mark

    CALL Colour(NewColour) matched to using a procedure

  • 1 mark

    Value ← (A1 + A2 + A3) / 3 matched to finding an average

  • 1 mark

    Loop1 ← Loop1 + 1 matched to counting

  • 1 mark

    IF Count > 7 THEN X1 ← 0 matched to using a conditional statement

3b · 4 marks

  • 1 mark

    initialise a variable to store the lowest number set to a high value (at least 100) / first value in the array

  • 1 mark

    loop structure to iterate 25 times

  • 1 mark

    use of IF to check if the array element is less than the current lowest value

  • 1 mark

    …if it is, set this to the lowest value

4a · 4 marks

  • 1 mark

    Line 01 / DECLARE City ARRAY[1:50, 1:2] OF BOOLEAN should be DECLARE City : ARRAY[1:50, 1:2] OF STRING Line 05 / IF should be REPEAT

  • 1 mark

    Line 07 / INPUT City[Count, 2] should be INPUT City[Count, 1]

  • 1 mark

    Line 11 / UNTIL Count = 50 // Line 04 / Count ← 1 AND Line 10 / Count ← Count + 1 should be UNTIL Count = 51 / UNTIL Count > 50 // Line 04 / Count ← 0 AND move Line 10 to beginning of loop / Line 06

  • 1 mark

    Line 12 / FOR Out ← 1 TO 1 should be FOR Out ← 1 TO 50

4b · 5 marks

  • 1 mark

    add an input (and prompt to ask) for the country to be searched

  • 1 mark

    …between lines 11 and 12

  • 1 mark

    …using a new variable for the input

  • 1 mark

    Add an IF statement to check if the current Country array element matches the country being searched

  • 1 mark

    …between lines 12 and 13

5 · 3 marks

  • 1 mark

    variables and constants should have meaningful identifiers

  • 1 mark

    …so that programmers/future programmers are able to understand their purpose

  • 1 mark

    they are both used for data storage

6a · 5 marks

  • 1 mark

    Value column correct

  • 1 mark

    Average column correct

  • 1 mark

    Total column correct

  • 1 mark

    Count column correct

  • 1 mark

    OUTPUT column correct

6b · 2 marks

  • 1 mark

    to add together / find the average of a batch of numbers

  • 1 mark

    the total and average are output (when the batch is complete/when 0 is entered)

7 · 5 marks

  • 1 mark

    storing string in Quote

  • 1 mark

    correct assignment for Start // sending correct start value

  • 1 mark

    correct assignment for Number // sending correct number of characters

  • 1 mark

    use of SUBSTRING function with first parameter as Quote, or equivalent, plus two other parameters

  • 1 mark

    correct use of LCASE function

8 · 4 marks

  • 1 mark

    Procedures: to enable the programmer to write a collection of programming statements under a single identifier

  • 1 mark

    Procedures: to allow modular programs to be created // to allow procedures to be re-used within the program or in other programs

  • 1 mark

    Parameters: to pass values from the main program to a procedure / function

  • 1 mark

    Parameters: …so that they can be used in the procedure / function

9a · 4 marks

  • 1 mark

    NAND gate with inputs A and B

  • 1 mark

    XOR gate with inputs B and C

  • 1 mark

    NOT gate with input from XOR gate

  • 1 mark

    OR gate with inputs from NAND gate and NOT gate, outputting Z

9b · 4 marks

  • 4 marks

    Four marks for eight correct outputs. Three marks for six or seven correct outputs. Two marks for four or five correct outputs. One mark for two or three correct outputs.

10a · 1 mark

  • 1 mark

    18

10b · 2 marks

  • 1 mark

    Code

  • 1 mark

    Each entry in this field is a unique identifier

10c · 2 marks

  • 2 marks

    Two marks for four correct answers. One mark for two or three correct answers.

10d · 3 marks

  • 1 mark

    SELECT Code, Breed

  • 1 mark

    FROM Horses

  • 1 mark

    WHERE BreedOrigin = "Scotland";

11 · 15 marks

  • 9 marks

    AO2: Apply knowledge and understanding of the principles and concepts of computer science to a given context, including the analysis and design of computational or programming problems (maximum 9 marks)

  • 6 marks

    AO3: Provide solutions to problems by evaluating computer systems, making reasoned judgements, presenting conclusions (maximum 6 marks)

Questions

  1. 2
    Question 27 marks
    Mark scheme ›
  2. 3
    Question 38 marks
    Mark scheme ›
  3. 4
    Question 49 marks
    Mark scheme ›
  4. 5
    Question 53 marks
    Mark scheme ›
  5. 6
    Question 67 marks
    Mark scheme ›
  6. 7
    Question 75 marks
    Mark scheme ›
  7. 8
    Question 84 marks
    Mark scheme ›
  8. 9
    Question 98 marks
    Mark scheme ›
  9. 10
    Question 108 marks
    Mark scheme ›
  10. 11
    Question 1115 marks
    Mark scheme ›

More 0478 papers

Other papers from Oct/Nov 2023

Solve it on ExamPalStart