Вы находитесь на странице: 1из 1

Cambridge University Press 2011 Revision questions: 10 Programs & pseudocude algorithms 1 Cambridge IGCSE Computer Studies

Programs and
pseudocude algorithms
10 10
1 Write an algorithm to calculate the average of ten numbers. (Average = Total of the ten numbers
divided by 10.)
2 What is the diference between machine code and a program written in a high-level language?
3 Write an algorithm which will input a sequence of eight numbers between 1 and 1,000,000, and
print a list of all eight numbers together with the largest and smallest number in the list.
4 List four high-level programming languages.
5 Read this algorithm.
Set Result to 0
INPUT Number
WHILE Number >= 0
DO
IF Number > Result THEN Result Number
INPUT Number
ENDWHILE
OUTPUT Result
a What is the purpose of this algorithm?
b What value of input will stop the loop and output the answer?
c Copy and complete the following trace table for the input values 6, 12, 8 and 3.

Result Number OUTPUT

Вам также может понравиться