IGCSE Computer Science 0478 Paper 23, Oct/Nov 2023

Question paper and mark scheme75 marks8 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/23 · Oct/Nov 2023

Download PDF
3
a

Four pseudocode descriptions and five pseudocode keywords are shown. Draw one line to link each pseudocode description to the most appropriate pseudocode keyword. Not all pseudocode keywords will be used. Pseudocode description: stores data in a file retrieves data from a file displays data on a screen enters data from a keyboard Pseudocode keyword: OUTPUT WRITE READ OPEN INPUT

[4]
b

Give two reasons for storing data in a file. 1 ................................................................................................................................................ ................................................................................................................................................... 2 ................................................................................................................................................ ...................................................................................................................................................

[2]
4

A programmer is writing a data entry program for booking theatre seats. The programmer needs the program to accept only whole numbers that are greater than or equal to one and less than or equal to six.

a

Give the names of two validation checks that are required for this program. 1 ................................................................................................................................................ 2 ................................................................................................................................................

[2]
b

Complete this pseudocode to perform your two validation checks, using your answers given in (a): OUTPUT "Please enter the number of seats you want to book " INPUT Seats

[5]
c

Give one item of test data to use when testing this program. State the reason for your choice of test data. Test data ................................................................................................................................... Reason for choice ..................................................................................................................... ...................................................................................................................................................

[2]
5

An algorithm has been written in pseudocode to check if a new password is in a list of previously used passwords OldList[] If the password is not found, the new password will be stored at the end of the list to replace "XXXX" already stored there. 01 OUTPUT "Enter your new password " 02 INPUT NewPassword 03 Posn ← 1 04 Found ← FALSE 05 REPEAT 06 IF Password = OldList[Posn] 07 THEN 08 Found ← TRUE 09 ELSE Posn ← Posn + 1 10 ENDIF 11 UNTIL Found AND OldList[Posn] = "XXXX" 12 IF Found 13 THEN 14 OUTPUT "Password has been used before" 15 ELSE 16 INPUT "New password accepted" 17 OldList[Posn] ← NewPassword 18 ENDIF

Figure 1 of 2 for question 5
Figure 2 of 2 for question 5
a

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

[3]
b

Complete this flowchart for the corrected algorithm:

[6]
6

There are three descriptions of logic gates. Each logic gate has two inputs A and B with one output X. Identify each logic gate. Complete a truth table for each logic gate.

a

The only time the output is 1 is when both inputs are 1. Logic gate ............................................... Complete the truth table for this description. A | B | X 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 |

[2]
b

The output is 1 when both inputs are different. Logic gate ............................................... Complete the truth table for this description. A | B | X 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 |

[2]
c

The only time the output is 1 is when both inputs are 0. Logic gate ............................................... Complete the truth table for this description. A | B | X 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 |

[2]
d

Consider this logic expression: X = (NOT A OR NOT B) OR NOT C Draw a logic circuit for this logic expression. Each logic gate must have a maximum of two inputs. Do not attempt to simplify this logic expression.

[5]
7

A program uses both local variables and global variables. Describe two differences between local variables and global variables. Difference 1 ...................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... Difference 2 ...................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... ..........................................................................................................................................................

[4]
8

This is an algorithm to find if a batch of parts has been manufactured successfully.

Figure 1 of 1 for question 8
a

Complete the trace table using this data: Y, Y, Y, N, Y, Y, Y, Y, N, Y, Y, Y, Y

[5]
b

Describe how the algorithm should be changed to accept ‘Y’ or ‘y’ for a successfully manufactured part.

[3]
9

A sanctuary for pheasants has set up a new database table called PheasantList to store details of the different species of bird at the sanctuary. Part of this table is given, showing: species, description, number of birds at the sanctuary, if the birds are breeding or not, and number of young born this year. Species | Description | NumberBirds | Breeding | Young Edwards | blue-black with white tail | 5 | Yes | 0 Japanese green | dark green with pale grey tail | 2 | Yes | 2 Reeves | golden, white and red scaled plumage | 4 | Yes | 1 Crawfords Kalij | glossy blue-black plumage | 4 | No | 0 Crested fireback | blue-black with black tail | 3 | No | 0 True silver | white laced top half and black lower half | 7 | Yes | 1 Siamese fireback | grey plumage with crimson legs and feet | 5 | No | 0 Mikado | iridescent plumage with white striped wings | 3 | Yes | 4 Red junglefowl | many colours | 2 | Yes | 0 Himalayan monal | many colours with metallic green crest | 3 | Yes | 2 White eared | white with ear tufts | 5 | Yes | 3 Brown eared | brown with ear tufts | 9 | Yes | 1 Ring necked | long tail with white ring neck | 2 | Yes | 2 Golden | rainbow coloured | 3 | Yes | 4

a

State the number of records and fields in this part of the database table. Records ..................................................................................................................................... Fields .........................................................................................................................................

[2]
b(i)

Give the name of a field that could be used for the primary key.

[1]
b(ii)

Explain why the sanctuary might decide not to use the field in (b)(i) as the primary key.

[1]
b(iii)

A new field SpeciesID is added to the database table. This field contains a six-character code, for example Ph0001. Give a reason why this field would be a better primary key.

[1]
c

Write the output that would be given by this structured query language (SQL) statement: SELECT Species, Description FROM PheasantList WHERE NumberBirds > 6;

[2]
d

Complete this SQL statement to display all the species of pheasant where the birds are breeding and there were no young born this year: SELECT .................................................................................................................................... FROM ........................................................................................................................................ WHERE ...................................................................................................................................... .............................................................................................................................................. ;

[4]
10

A weather station takes temperature readings once an hour for a week. These temperatures are stored in a two-dimensional (2D) array Temperatures[] Each column contains 24 readings for a single day. The first temperature is recorded at 00:00 and the final temperature at 23:00. There are seven columns, one for each day of the week, starting with Monday and ending with Sunday. The variables MaxDay, MinDay and AvDay are used to store the maximum, minimum, and average temperatures for a day. The variables MaxWeek, MinWeek and AvWeek are used to store the maximum, minimum, and average temperatures for the week. The array has already been set up and the data stored. Write a program that meets the following requirements: • finds the maximum and minimum temperatures for each day • calculates the average temperature for each day • outputs for each day: – name of the day, for example Monday – maximum temperature – minimum temperature – average temperature • finds the maximum and minimum temperatures for the week • calculates the average temperature for the week • outputs: – maximum temperature for the week – minimum temperature for the week – average temperature for the week. All temperatures output must be rounded to two decimal places. You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs must contain suitable messages. You do not need to declare any arrays or variables; you may assume that this has already been done. You do not need to initialise the data in the array Temperatures[]

[15]

Mark scheme

0478/23 · Oct/Nov 2023

Download PDF

3a · 4 marks

  • 1 mark

    stores data in a file to WRITE

  • 1 mark

    retrieves data from a file to READ

  • 1 mark

    displays data on a screen to OUTPUT

  • 1 mark

    enters data from a keyboard to INPUT

3b · 2 marks

  • 1 mark

    data is stored permanently

  • 1 mark

    data can be moved to another computer

  • 1 mark

    another copy of data can be made and stored//accessed elsewhere // backup copy

4a · 2 marks

  • 1 mark

    type check

  • 1 mark

    range check

4b · 5 marks

  • 1 mark

    use of loop for check

  • 1 mark

    checking for whole number

  • 1 mark

    checking for number greater than or equal to one

  • 1 mark

    … and less than or equal to six

  • 1 mark

    Appropriate error/reinput message

  • 1 mark

    ability to reinput value

4c · 2 marks

  • 1 mark

    correct test data

  • 1 mark

    corresponding reason

5a · 3 marks

  • 1 mark

    Line 06 Password should be NewPassword

  • 1 mark

    Line 11 AND should be OR

  • 1 mark

    Line 16 INPUT should be OUTPUT

5b · 6 marks

  • 1 mark

    data entry with message

  • 1 mark

    initialisation

  • 1 mark

    checking list // decision box comparing input with array

  • 1 mark

    updating // updating the two variables position and found

  • 1 mark

    loop control // second decision box

  • 1 mark

    setting new password to position in list

  • 1 mark

    outputs // two outputs

  • 1 mark

    correct use of flow chart symbols

  • 1 mark

    correct use arrows and labels

6a · 2 marks

  • 1 mark

    AND gate name

  • 1 mark

    truth table (0, 0, 0, 1)

6b · 2 marks

  • 1 mark

    XOR // EOR gate name

  • 1 mark

    truth table (0, 1, 1, 0)

6c · 2 marks

  • 1 mark

    NOR gate name

  • 1 mark

    truth table (1, 0, 0, 0)

6d · 5 marks

  • 1 mark

    NOT gate connected to input A

  • 1 mark

    NOT gate connected to input B

  • 1 mark

    NOT gate connected to input C

  • 1 mark

    OR gate connected to outputs of NOT A and NOT B

  • 1 mark

    NAND gate connected to output of OR gate and output of NOT C, giving output X

7 · 4 marks

  • 1 mark

    local variables - scope is a defined block of code/subroutine/procedure/function

  • 1 mark

    global variables – scope is the whole program

  • 1 mark

    local variables - value cannot be changed elsewhere in the program

  • 1 mark

    global variables – value can be changed anywhere in the program

8a · 5 marks

  • 1 mark

    Accept column correct

  • 1 mark

    Reject column correct

  • 1 mark

    PartOK column correct

  • 1 mark

    Error column correct

  • 1 mark

    OUTPUT column correct

8b · 3 marks

  • 1 mark

    after the Input box // before the first decision box / change the first decision / add another decision box

  • 1 mark

    insert a process box / to accept 'y' as well

  • 1 mark

    to convert the input to upper case / by adding OR PartOK = 'y'

9a · 2 marks

  • 1 mark

    Records: 14

  • 1 mark

    Fields: 5

9b(i) · 1 mark

  • 1 mark

    Species/Description

9b(ii) · 1 mark

  • 1 mark

    Long names that could be easily misspelt // species or description could be duplicated

9b(iii) · 1 mark

  • 1 mark

    Easy to validate // always unique

9c · 2 marks

  • 1 mark

    True silver white laced top half and black lower half

  • 1 mark

    Brown eared brown with ear tufts

9d · 4 marks

  • 1 mark

    SELECT Species

  • 1 mark

    FROM PheasantList

  • 1 mark

    WHERE Breeding (or WHERE Young = 0)

  • 1 mark

    AND Young = 0; (or AND Breeding;)

10 · 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. 3
    Question 36 marks
    Mark scheme ›
  2. 4
    Question 49 marks
    Mark scheme ›
  3. 5
    Question 59 marks
    Mark scheme ›
  4. 6
    Question 611 marks
    Mark scheme ›
  5. 7
    Question 74 marks
    Mark scheme ›
  6. 8
    Question 88 marks
    Mark scheme ›
  7. 9
    Question 911 marks
    Mark scheme ›
  8. 10
    Question 1015 marks
    Mark scheme ›

More 0478 papers

Other papers from Oct/Nov 2023

Solve it on ExamPalStart