Past-paper question · 2017 May-June · Paper 22 · Q4(a)

Question 4(a) 2017 · May-June · Paper 22 · 17 marks

Original past-paper question for 4(A)
Original past-paper question for 4(A)
Original past-paper question for 4(A)
Original past-paper question for 4(A)
Reveal official mark-scheme answer Official mark-scheme answer for 4(A)

Official answer for Question 4

Part (a)

✓
•
✓
Functions
✓
•
✓
Procedures
✓
•
✓
Global / Local variables

Mark scheme 9608_s17_ms_22.pdf →

Show text version of question

Question 4

Part (a)

Question 4

WRITEFILE (MyFile, "Data is " & String2)

[6]

Part (b)

(i)

Complete the following two sentences.

A
suitable operand type for an arithmetic operator is ........................................................
A
suitable operand type for a logical operator is ...............................................................
[2]

(ii)

The following table shows the values of three variables.

Variable Value FlagA TRUE FlagB FALSE FlagC TRUE

Evaluate these expressions.

Expression Evaluates to

(FlagA AND FlagB) OR FlagC

FlagA AND (FlagB OR FlagC)

(NOT FlagA) OR (NOT FlagC)

[3]

Question 3

Part (c)

The loop construct (also known as repetition or iteration) appears in many algorithms.

Use pseudocode to write a post-condition loop to output all the odd numbers between 100 and 200.

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

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

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

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

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

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

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

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

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

[4]

Question 4

2 A multi-user computer system maintains a text file containing the ID and preferred name for each user. User IDs are unique. Preferred names may be repeated.

Part (a)

Stepwise refinement is to be applied to the following three steps.

After a user logs in, a welcome message is produced as follows:

1. Search for the user ID in the file. 2. Read the preferred name from the file. 3. Output the welcome message.

Describe the goal of stepwise refinement.

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

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

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

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

[2]
Topic relevance

Why this question appears here

75% assigned-topic match · Hardware › Logic gates and logic circuits

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 9608_s17_qp_22.pdf

Keep practising this topic