IGCSE Computer Science 0478 Paper 23, May/June 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/23 · May/June 2023

Download PDF
2

Explain the purpose of the library routines MOD and RANDOM MOD ................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... RANDOM ............................................................................................................................................ .......................................................................................................................................................... .......................................................................................................................................................... ..........................................................................................................................................................

[4]
3

Describe what happens when a function is called during the execution of a program.

[3]
4
a

Explain why verification checks are used when data is input.

[2]
b

Give two types of verification check and state how each one can be used. Verification check 1 ................................................................................................................... Use ........................................................................................................................................... ................................................................................................................................................... Verification check 2 ................................................................................................................... Use ........................................................................................................................................... ...................................................................................................................................................

[4]
5
Figure 1 of 1 for question 5
a

Four descriptions of validation checks are shown. Draw one line to link each description to the most appropriate check. Not all checks will be used. Description to check that the data entered is an integer to check that some data has been entered to check that the data entered has an appropriate number of characters to check that an identification number contains no errors Check check digit format check length check presence check type check

[4]
b

Write an algorithm in pseudocode to make sure that an input for the variable Length is between 15 and 35 inclusive. The code must iterate until a valid input has been made and the code must include appropriate messages.

[3]
6

An algorithm has been written in pseudocode to allow 100 positive numbers to be input. The total and the average of the numbers are output. 01 Counter ← 100 02 Total ← 0 03 WHILE Counter > 100 DO 04 INPUT Number 05 IF Number > 0 06 THEN 07 Total ← Total + Counter 08 Counter ← Counter + 1 09 ENDCASE 10 ENDWHILE 11 OUTPUT "The total value of your numbers is ", Total 12 OUTPUT "The average value of your numbers is ", Total / 100

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 so that a count-controlled loop is used to allow 100 positive numbers to be input. You do not need to rewrite the algorithm.

[5]
7

The flowchart represents an algorithm. An input of –1 will terminate the algorithm.

Figure 1 of 2 for question 7
Figure 2 of 2 for question 7
a

Complete the trace table for the input data: 5, 50, 52, 555, 57, 500, –1, 5500, 55

[6]
b

Describe the purpose of the algorithm.

[2]
8

Consider the logic expression: Z is 1 if (A = 1 AND C = NOT 1) AND (B = 1 NOR C = 1)

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]
9

The variable Saying is used to store string data in a program.

a

Write the pseudocode statement to declare the variable Saying

[1]
b

Write the pseudocode statements to: • allow a string to be input to the variable Saying • store the content of the variable Saying in a text file named "Quotations.txt" • make sure the text file is closed at the end of the algorithm.

[5]
10

A database table called Site1 stores details of some holiday homes at a holiday park. The database shows the type of home, number of guests, whether it is privately owned and the weekly rate to hire it. Name | Type | Private | Rate$ | NumberGuest Bay Lodge | Lodge | NO | 1000 | 10 Bay View | Cabin | NO | 400 | 4 Blue Skies | Cabin | NO | 350 | 4 Cliff View | Cabin | NO | 650 | 6 Coppice Lodge | Lodge | NO | 1200 | 12 Green Lodge | Lodge | NO | 1000 | 8 Henry | Cabin | YES | 300 | 2 Hikers' Rest | Retreat | NO | 750 | 6 Poppy | Cabin | NO | 300 | 2 Summer Joy | Retreat | YES | 750 | 6 Valley View | Cabin | NO | 600 | 6 West Lodge | Lodge | YES | 1200 | 12

a

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

[2]
b

Describe the purpose of a primary key.

[1]
c

The database uses the data types: • alphanumeric • character • Boolean • integer • real • date/time. Complete the table to show the most appropriate data type for each field.

[2]
d

Give the output that would be produced by the structured query language (SQL) statement: SELECT Name, NumberGuest, Rate$ FROM Site1 WHERE NumberGuest >= 10;

[3]
11

A two-dimensional (2D) array Contacts[] is used to store names and telephone numbers. All the data is stored as strings. The array must have the capacity to store 100 contacts in the form of: • column 1 – contact names as: last name, first name for example: Smith, John • column 2 – telephone numbers. The variable CurrentSize shows how many contacts are in the array. Write a program that meets the following requirements: • display a menu of choices: ○ enter new contact details ○ display all the contact details ○ delete all the contact details • validate the menu input • allow up to a maximum of five new contacts to be added to the array at any one time • do not allow more than 100 contacts in total • after new contacts have been added, sort the array by contact name, as long as there are at least two contacts in the array • output the whole of the array • delete the contents of the array. You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays, variables or constants; you may assume that this has already been done. All inputs and outputs must contain suitable messages. You do not need to initialise the data in the array Contacts[] and the variable CurrentSize

[15]

Mark scheme

0478/23 · May/June 2023

Download PDF

2 · 4 marks

  • 1 mark

    To perform (integer) division when one number is divided by another

  • 1 mark

    … and find the remainder

  • 1 mark

    To generate (pseudo) random numbers

  • 1 mark

    …(usually) within a specified range

3 · 3 marks

  • 1 mark

    A call statement is used in order to make use of a function // the function is called using its identifier

  • 1 mark

    Parameters are / may be passed (from the main program) to the function (to be used within the function)

  • 1 mark

    The function performs its task …

4a · 2 marks

  • 1 mark

    To ensure that data has been accurately copied // to ensure that changes have not been made to the values originally intended when data is copied

  • 1 mark

    … from one source to another

4b · 4 marks

  • 1 mark

    Verification check 1 – Visual check

  • 1 mark

    Use – the user looks through the data that has been entered and confirms that no changes have been made.

  • 1 mark

    Verification check 2 – Double data entry

  • 1 mark

    Use – data is entered twice, the two entries are compared and if they do not match, a re-entry is requested.

5a · 4 marks

  • 1 mark

    to check that the data entered is an integer → type check

  • 1 mark

    to check that some data has been entered → presence check

  • 1 mark

    to check that the data entered has an appropriate number of characters → length check

  • 1 mark

    to check that an identification number contains no errors → check digit

5b · 3 marks

  • 1 mark

    appropriate REPEAT / WHILE loop begin and end

  • 1 mark

    input of Length

  • 1 mark

    appropriate input prompt / error message

6a · 4 marks

  • 1 mark

    Line 01 / Counter ← 100 should be Counter ← 0

  • 1 mark

    Line 03 / While Counter > 100 DO should be While Counter < 100 DO

  • 1 mark

    Line 07 / Total ← Total + Counter should be Total ← Total + Number

  • 1 mark

    Line 09 / ENDCASE should be ENDIF

6b · 5 marks

  • 1 mark

    replace line 03

  • 1 mark

    with FOR

  • 1 mark

    … with limits 0 to 99 / 1 to 100

  • 1 mark

    replace line 05 to check if Number is not positive

  • 1 mark

    … (if Number is not positive) insert a validation and re-input routine between lines 06 and 07 …

7a · 6 marks

  • 1 mark

    correct Total column

  • 1 mark

    correct Value column

  • 1 mark

    correct Five1 column

  • 1 mark

    correct Five2 column

  • 1 mark

    correct Ten1 and Ten2 columns

  • 1 mark

    correct OUTPUT column

7b · 2 marks

  • 1 mark

    to find if an input is divisible by (both 5 and) 10

  • 1 mark

    … add them together and output the total

8a · 4 marks

  • 1 mark

    NOR gate with inputs B and C

  • 1 mark

    NOT gate with input C

  • 1 mark

    AND gate with inputs A and output of NOT gate

  • 1 mark

    Final AND gate with inputs from first NOR gate and middle AND gate producing output Z

8b · 4 marks

  • 4 marks

    Correct output column Z (0, 0, 0, 0, 1, 0, 0, 0)

9a · 1 mark

  • 1 mark

    DECLARE Saying : STRING

9b · 5 marks

  • 1 mark

    input a string into Saying

  • 1 mark

    correct use of OPENFILE to write data

  • 1 mark

    correct use of WRITEFILE to write Saying

  • 1 mark

    correct use of CLOSEFILE

  • 1 mark

    correct use of filename Quotations.txt throughout

10a · 2 marks

  • 1 mark

    Fields 5

  • 1 mark

    Records 12

10b · 1 mark

  • 1 mark

    to uniquely identify a record

10c · 2 marks

  • 2 marks

    All four correct data types (Type: Alphanumeric, Private: Boolean, Rate$: Integer, NumberGuest: Integer)

10d · 3 marks

  • 1 mark

    data correctly extracted in any two rows

  • 1 mark

    data correctly extracted in third row

  • 1 mark

    data in correct order horizontally and vertically

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 (up to 9 marks)

  • 6 marks

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

Questions

  1. 2
    Question 24 marks
    Mark scheme ›
  2. 3
    Question 33 marks
    Mark scheme ›
  3. 4
    Question 46 marks
    Mark scheme ›
  4. 5
    Question 57 marks
    Mark scheme ›
  5. 6
    Question 69 marks
    Mark scheme ›
  6. 7
    Question 78 marks
    Mark scheme ›
  7. 8
    Question 88 marks
    Mark scheme ›
  8. 9
    Question 96 marks
    Mark scheme ›
  9. 10
    Question 108 marks
    Mark scheme ›
  10. 11
    Question 1115 marks
    Mark scheme ›

More 0478 papers

Other papers from May/June 2023

Solve it on ExamPalStart