Professional Documents
Culture Documents
Tracing Practice 2
Tracing Practice 2
START
INPUT a,b,c
Yes Yes
is a>b is a>c OUTPUT a
No No
No
is b>c OUTPUT c
Yes
OUTPUT b
STOP
INPUT
OUTPUT
a b c
5 9 7
4 1 8
2 4 2
[3]
Page 2 of 11
START
INPUT A, B, C, D, E
K=0
X=0
K=A
No A=B
is A > B ?
B=K
X=1
Yes
K=B
No B=C
is B > C ?
C=K
X=1
Yes
X=0
K=C
No C=D
is C > D ?
D=K
X=1
Yes
K=D
No D=E
is D > E ?
E=K
X=1
Yes
Yes No
is X = 1 ? OUTPUT
A, B, C, D, E
END
Page 3 of 11
(a) Complete the trace table for this flowchart using the following test data:
3, 5, 1, 4, 8
A B C D E K X
[5]
(b) What values are output from the flowchart using the above test data?
[1]
[1]
(d) What would happen if the value of X wasn’t set to 0 in the return loop of the flowchart?
[1]
Page 4 of 11
16 A large word processor is being developed by first writing a series of modules. These are
then put together to form the final word processor. Testing is done on each module and on
the final word processor. The following flowchart shows how this word processor is
developed. Several of the stages have been omitted.
Complete the flowchart, using item number only, from the list of items given.
START
WRITE the
module
Yes
ITEM LIST
Item Item
No
Number Description
No
Yes
END
[5]
Page 5 of 11
9 The following flowchart shows what happens when a customer withdraws cash from an
Automatic Teller Machine (ATM) using a credit card protected by a Personal Identification
Number (PIN). Complete the flowchart by selecting the appropriate statement from the given
list and inserting the number in its correct box (2 statements are already inserted for you).
Read number
on credit card Start
Yes
2.
card stolen? End
No
LIST OF STATEMENTS
End
No
Yes
End
[6]
Page 6 of 11
11 Majid lives in Cairo but often travels to Tokyo, Mumbai and Washington. A flow chart has
been written so he can work out the local time in these three places.
START
Input place
Yes H=H+7
Is place=Tokyo
M=M+0
No
Yes H=H+3
Is place=Mumbai
M = M + 30
No
Yes H=H–7
Is place=Washington
M=M+0
No
Output H, M
Is place=End
No
Yes
STOP
Page 7 of 11
Input Output
Tokyo 11 15
Mumbai 15 10
[2]
(b) What problem would occur if place = Mumbai and H = 15 and M = 30?
[1]
[1]
Page 8 of 11
17 The following flowchart shows how the bar code written on an item is used to find the price,
do stock control and produce an itemised bill. Select statements from the list below to
complete the flowchart.
No manually key
output an
in bar code
error message
number
Yes
has bar
code been
Yes found?
No
Yes
No
END
[5]
Page 9 of 11
17 The following flowchart shows how sensors (which can be analogue or digital) and a
computer are used to control the temperature of a greenhouse for plants. Complete the
flowchart using the items from the list below.
START
Read input
temperature from sensor
Yes
No
LIST OF ITEMS
Yes
No
STOP
[6]
Page 10 of 11
START
C=1
INPUT N
N = N/10
Is Yes
OUTPUT C STOP
N < 1?
No
C=C+1
Complete the table to show what outputs you would expect for the three inputs.
INPUT N OUTPUT C
55
2100
[3]
Page 11 of 11
The flowchart below shows the log on procedure. Several boxes have been left blank.
START
List
Enter user 1 Access not allowed
id 2 Allow access
3 Do user id and password match?
4 Enter password
5 Error message
6 Error message
7 Three attempts?
Yes
No
Yes
No
STOP
[3]
[1]