Past-paper question · 2024 October-November · Paper 23 · Q30

Question 30 2024 · October-November · Paper 23 · 31 marks

Original past-paper question for 30
Reveal official mark-scheme answer

The answer for this question is in the official mark scheme: open the mark scheme.

Mark scheme 0478_w24_ms_23.pdf →

Show text version of question

Question 30

ENDIF

Part (a)

Complete the three trace tables using the data shown for each one.

Data: MYWORD

Password Accept Index Found OUTPUT

Question 9

, ,

Data: M!word

Password Accept Index Found OUTPUT

Data: My!Hidden

Password Accept Index Found OUTPUT

[6]

Part (b)

State the rules that the password must meet.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

[3]

Question 10

, ,

11 Building materials are sold in bags. A new database table called BuildStock has been set up to store details about the materials for sale. Part of this table is given.

MtNo Name InStock WeightKg PricePerBag NumberBags MT01 Builders sand Yes 50 4.50 50 MT02 Sharp sand Yes 25 3.50 21 MT03 Red sand No 50 2.75 0 MT04 Cement No 25 6.85 0

MT05 Chippings Yes 50 35.00 50 MT06 Cobbles No 75 67.35 0 MT07 Pebbles small Yes 50 34.50 3 MT08 Pebbles medium Yes 25 25.50 10 MT12 Pebbles large Yes 75 62.75 20 MT15 Washed gravel Yes 50 12.75 12 MT16 Pea gravel Yes 100 15.95 24

Part (a)

Write the output from this structured query language (SQL) statement.

SELECT MtNo, Name FROM BuildStock WHERE WeightKg = 75 ORDER BY PricePerBag;

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................

[3]

Part (b)

(i)

Complete this SQL statement to display only the names of all the materials that are out

of stock.

SELECT .............................................................................................................................

FROM ..................................................................................................................................

WHERE ...............................................................................................................................

[2]

(ii)

Explain how another SQL statement using a different field could be used to display the

same information.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.....................................................................................................................................

[2]

,

,

Question 11

Question 12

, ,

12 Members of a litter picking group complete a litter pick every month. Members’ names are stored in one-dimensional (1D) array PickerName[]

Each member stores the weight of the litter they have picked in another one-dimensional (1D) array PickedWeight[] The weights are in kilograms with one decimal place, for example 8.4

The position of each member’s data in the two arrays is the same. For example, the member stored at index 10 in PickerName[] and at index 10 in PickedWeight[] is the same.

Every month, there is a small prize awarded to the members of the group who have the two

heaviest weights. Certificates are awarded to all members with a pick weight of over three kilograms.

Write a program that meets the following requirements:

  • allows the weight of members’ picks to be input and validated
  • sorts the arrays PickedWeight[] and PickerName[] in descending order of weight
  • outputs the member names and the pick weights of the members with the two heaviest picks
  • and identifies them as “Best in Group” and “Second best in Group”

  • stores the names of all the members who will receive a certificate in the array
  • PickerCertificate[]

  • outputs a message stating the number of certificates to be printed.

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.

All inputs and outputs must contain suitable messages.

You do not need to initialise the data in the array PickerName[]

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Question 13

, ,

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Question 14

, ,

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..................................................................................................................................................

[15]

,

,

Question 15

Question 16

, ,

reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cambridgeinternational.org after the live examination series.

Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.

Topic relevance

Why this question appears here

98% assigned-topic match · Databases

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 0478_w24_qp_23.pdf

Keep practising this topic