Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Page 1 of 11

12 Study the following flow diagram.

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

Write down the output for each of the following inputs:

INPUT
OUTPUT
a b c

5 9 7

4 1 8

2 4 2
[3]
Page 2 of 11

12 Study the following flowchart very carefully.

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]

(c) What function is this flowchart carrying out?

[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

1 any errors in the module?


2 any more modules to write and test?
Yes 3 combine all modules to form final
word processor

No 4 does final word processor give


expected results?
5 modify final word processor
6 modify the module
7 test module using data with known
outcomes
8 test final word processor using data
with known outcomes
9 write user documentation

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

No 1. card ejected from ATM


2. card stolen?
No 9. 3. card retained
is this the 4. sufficient funds?
third attempt? 5. input PIN
Yes 6. money and card returned
7. is PIN correct?
Yes 8. select amount of money
9. is this the third attempt?
10. Update customer files

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 time in hours


(H) and minutes (M)

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

(a) What output would be produced from the following input?

Input Output

place hours (H) minutes (M) H M

Tokyo 11 15

Mumbai 15 10
[2]

(b) What problem would occur if place = Mumbai and H = 15 and M = 30?

[1]

(c) What problem would occur if place = Washington and H = 4 and M = 0?

[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.

START List of Statements


1 Any more bar codes to read?
2 Has bar code been found in the file?
3 Look up the price of item in the file
read next 4 Output error report
bar code 5 Output itemised bill
6 Reject item
7 Update stock file

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

1 compare input temperature


with set temperature
2 is input temperature = set
Yes temperature
3 is input temperature < set
temperature
No 4 is input temperature > set
temperature
5 is input signal analogue
Yes 6 output “error”
7 read set temperature from file
8 switch on cooler
9 switch on heater
No 10 system fault
11 use ADC to convert signal

Yes

No

STOP

[6]
Page 10 of 11

9 Study the flowchart.

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

4 (a) To log on to a computer, a user needs to type in a user id followed by a password;


these should match up. Only three attempts are allowed.

The flowchart below shows the log on procedure. Several boxes have been left blank.

Complete the flowchart using items from the list.

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]

(b) Sometimes it is necessary to key in the password twice.

Name this type of data check.

[1]

You might also like