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

Cambridge University Press 2011

Programs and
pseudocode algorithms
10 10
Cambridge IGCSE Computer Studies Answers to Revision questions: 10 Programs & pseudocode algorithms 1
Below each answer there is a page reference for the coursebook. Tis is there to help you focus
your revision. If you fnd that you get an answer wrong, you can use this guide to return to the
coursebook to revise the areas that need some extra attention. Please note these are example
answers only and do not represent the only possible answers.
1
See Pseudocode on page 260.
2 Machine code is a program written in machine language that can be understood by a specifc
processor family. A program in a high-level language can be run on a number of diferent
processors but must be converted to machine code by a compiler or executed by an interpreter.
See Te concept of a program on page 255.
3
See Pseudocode on page 260.
4 COBOL, Delphi, C++ and Java are high-level programming languages.
See High-level languages on page 257.
Sum 0
FOR Count 1 TO 10
INPUT Number
Sum Sum + Number
NEXT
OUTPUT "Average = ", Sum / 10
Largest -1
Smallest 1000001
FOR Count 1 TO 8
INPUT Number
IF Number > Largest THEN Largest Number
IF Number < Smallest THEN Smallest Number
PRINT Number
NEXT
PRINT "Largest number is ", Largest
PRINT "Smallest number is ", Smallest
Cambridge University Press 2011 Cambridge IGCSE Computer Studies Answers to Revision questions: 10 Programs & pseudocode algorithms 2
5 a Te algorithm inputs a sequence of numbers and keeps a record of the largest number read
so far. Once the loop ends, it outputs the largest number input.
b Any value less than 0 stops the loop and outputs the answer.
c
See Testing and interpreting pseudocode algorithms on page 266.
Result Number OUTPUT
0 6
6 12
12 8
3 12

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