Past-paper question · 2016 May-June · Paper 22 · Q8(d)

Question 8(d) 2016 · May-June · Paper 22 · 20 marks

Original past-paper question for 8(D)
Original past-paper question for 8(D)
Original past-paper question for 8(D)
Original past-paper question for 8(D)
Reveal official mark-scheme answer

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

Mark scheme 2210_s16_ms_22.pdf →

Show text version of question

Question 8

Part (d)

Question 8

UNTIL Counter = 10

This code works, but it is inefficient.

(i)

Suggest three improvements that could be made.

1 .................................................................................................................................................

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

2 .................................................................................................................................................

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

3 .................................................................................................................................................

...............................................................................................................................................[3]

(ii)

Rewrite the program code with your improvements.

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

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

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

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

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

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

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

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

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

...............................................................................................................................................[3]

Question 7

3 The flowchart below calculates the number of tins of paint required to paint walls. The flowchart inputs the height and width of a wall in metres, the number of doors and the number of windows.

A
value of –1 for the height stops the input.

START

Area 0 Tins 0

INPUT Height, Width, Doors, Windows

Is Yes Height Tins INT(Area/10 + 0.5) = –1?

No

OUTPUT Tins Area Area + Height * Width

  • Doors * 1.5 – Windows

END

Complete the trace table for the input data:

3, 5, 1, 0, 3, 7, 0, 0, 3, 5, 0, 3, 3, 7, 1, 1, –1, 0, 0, 0

Area Tins Height Width Doors Windows

[4]

Question 8

4 Four statement types and four examples are shown below.

Draw a line to connect each statement type to the correct example.

Statement type Example

Assignment FOR X 1 TO 10

Iteration READ X

Input PRINT X

Output X Y + Z

[3]

5 A programmer writes a program to store a patient’s temperature every hour for a day.

State the data structure that would be most suitable to use and give the reason for your choice.

Data structure ...................................................................................................................................

Reason ..............................................................................................................................................

......................................................................................................................................................[2]

6 Identify two different selection statements that you can use when writing pseudocode.

1 ........................................................................................................................................................

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

2 ........................................................................................................................................................

......................................................................................................................................................[2]

Question 9

Question 7 begins on page 10.

Question 10

7 A database, SOFASELECT, was set up to show the prices of suites, sofas and chairs for sale from an online furniture warehouse. Part of the database is shown below.

Brochure Number Number Description Material Colour Price in $ Number of Seats of Pieces

Sofa SF17 2 1 Leather Red 950

Sofa SF19 3 1 Vinyl Black 1,000

Suite SU10 4 3 Velvet Green 1,500

Suite SU23 5 3 Leather Brown 950

Recliner chair RC01 1 1 Leather Cream 600

Chair CH16 1 1 Vinyl Red 250

Recliner sofa RS23 4 1 Leather Cream 1,200

Chair CH10 1 1 Velvet Red 175

Part (d)

The query-by-example grid below selects all the furniture in cream leather.

Field: Description Material Colour Price in $ Brochure Number Table: SOFASELECT SOFASELECT SOFASELECT SOFASELECT SOFASELECT Sort: Descending Show: Criteria: = ‘Leather’ = ‘Cream’ or:

Show the output from the query-by-example.

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

...............................................................................................................................................[3]

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 2210_s16_qp_22.pdf

Keep practising this topic