Sei sulla pagina 1di 15

Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.

A. Phiri

Algorithms - Flowcharts & Pseudocode -

1. Write an algorithm, using pseudocode or a flowchart, which:

• inputs the amount of a donation

• checks that the amount is between $1.00 and $10.00

• outputs an error message if not

• allows a maximum of 3 attempts

[6]
Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri
2.

3. Trace the flow chart using the numbers 2 and 3. Write down each of the values of N in

the order

that they are printed out.

(a) 2 ……………………………………………………………………………………. [1]

(b) 3 ……………………………………………………………………………………. [2]


Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri

4. Study the following flowchart very carefully.

5. (a) Complete the following table showing the expected output from the flowchart for

the

three sets of input data:

[3]
Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri
6. The following flowchart inputs two numbers, carries out a calculation and then outputs

the result.

(a) Complete the following table for the three sets of input data.

[3]

(b) The above algorithm has been placed in a library of routines. Give one advantage of

doing this.
Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri
………………………………………………………………………………………………

…………………………………………………………………………………………. [1]

7. The following flowchart inputs ten temperatures and outputs the average (mean)

temperature and the number of temperatures which were negative (i.e. < 0).

(a) Complete the trace table for this flowchart using the following test data:
Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri

[6]

(b) What values are output from the flowchart using the above test data? [1]

8. (i) Complete the truth table for the following logic circuit:
Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri

[2]

(ii) Which single logic gate has the SAME function as the above logic circuit? [1]

(b) (i) Complete the truth table for the following logic circuit:

[2]

(ii) Which single logic gate has the SAME function as the above logic circuit?

…………………………………………………………………………………….. [1]

9. Name two different types of loop structure in a typical programming language.

Give an example of how ten numbers could be input using the named loop.

Name of type of loop structure 1…………………………………………………………


Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri
Example

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

Name of type of loop structure 2…………………………………………………………

Example

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………… [6]

10. (a) (i) Complete the truth table for the logic circuit which is made up of NAND gates

only.

[2]
Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri
(ii) What single logic gate has the same function as the above logic circuit?

………….……………………………………………………………………………… [1]

(b) (i) Complete the truth table for the logic circuit.

[4]

(ii) What could replace the whole logic circuit?

………….……………………………………………………………………………… [1]
Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri

11. A customer uses Internet banking. To gain access to their account they need:

• an 8-digit ID

• a 4-digit PIN

• a 10-character password

They will be asked to type in their ID, then 3 digits from their PIN and finally 3

characters from their password. Three attempts at the ID are allowed, but only one

attempt at the PIN and at the password.

The flowchart on the next page shows the access process described above. However,

most of the stages have been omitted. Complete the flowchart, using item number only,

from the list of items given.


Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri
Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri

[6]

12. Study the following flowchart very carefully.


Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri
(a) Complete the trace table for this flowchart using the following test data:
Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri
(a) Complete the trace table for this flowchart using the following test data:

[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]
Computer Studies 7010/1 Topic by Topic Revision Tool Kit – by Mr. S.
A. Phiri
(e) (a) Draw the logic circuit represented by the logic statement:

[6]

Potrebbero piacerti anche