Unit_7_8_Worksheet 1 1
Unit_7_8_Worksheet 1 1
1 Write an algorithm in pseudocode to input 1000 numbers. Count how many numbers are positive and
how many numbers are zero. Then output the results.
................................................................................................................................................... .........................
.......................................................................................................................... ..................................................
................................................................................................. ...........................................................................
........................................................................ ....................................................................................................
............................................... .............................................................................................................................
...................... ................................................................................................................................................... ..
................................................................................................................................................. ...........................
........................................................................................................................ ....................................................
............................................................................................... .............................................................................
...................................................................... ......................................................................................................
............................................. ...............................................................................................................................
....................
................................................................................................................................................... .........................
.......................................................................................................................... ..................................................
................................................................................................. ...........................................................................
........................................................................ ....................................................................................................
............................................... .............................................................................................................................
...................... ....................................................................................................................................................
.............................................................................................................................................. [6]
2 (a) Find the four errors in the pseudocode and suggest corrections.
Error 1 .......................................................................................................................................
..........................................................................................................................
Error 2 .......................................................................................................................................
..........................................................................................................................
Error 3 .......................................................................................................................................
..........................................................................................................................
Error 4 .......................................................................................................................................
Correction .................................................................................................................................
................................................................................................................................................... [4]
(b) Show, using pseudocode, how you would change the corrected algorithm to print out any numbers
between 100 and 200 inclusive.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
3 Explain the difference between the programming concepts of sequence and selection.
Include an example of a programming statement for each concept in your
explanation. ........................................................................................................................................................
.. .......................................................................................................................................................... ...............
........................................................................................................................................... .................................
......................................................................................................................... ...................................................
....................................................................................................... .....................................................................
..................................................................................... .......................................................................................
................................................................... .........................................................................................................
................................................. ...........................................................................................................................
...........................[4]
algorithm. ..............................................................................................................................................
............................................................................................................................................. ..................
................................................................................................................................. ..............................
..................................................................................................................... ..........................................
.....................................................................................................[3]
................................................................................................................................................ ...............
.................................................................................................................................... ...........................
........................................................................................................................ .......................................
............................................................................................................ ...................................................
................................................................................................ ...............................................................
.................................................................................... ...........................................................................
........................................................................ .......................................................................................
............................................................ ...................................................................................................
............................................[3]
(c) Describe how you could modify the original algorithm shown at the start of question 4, to allow any
number of
............................................................................................................................................. ........................
........................................................................................................................... ..........................................
.....................................................................................................[2]
5 Write an algorithm, using pseudocode, to input three different numbers, multiply the two larger numbers
together and output the result. Use the variables: Number1, Number2 and Number3 for your numbers and
Answer for your result.
................................................................................................................................................... .........................
.......................................................................................................................... ..................................................
................................................................................................. ...........................................................................
........................................................................ ....................................................................................................
............................................... .............................................................................................................................
...................... ................................................................................................................................................... ..
................................................................................................................................................. ...........................
........................................................................................................................ ....................................................
............................................................................................... .............................................................................
...................................................................... ......................................................................................................
............................................. ...............................................................................................................................
....................
6 An algorithm has been written in pseudocode to input 50 numbers and total only the positive numbers.
Find the four errors in the pseudocode and suggest a correction for each error. Error
1 .......................................................................................................................................
..........................................................................................................................
Error 2 .......................................................................................................................................
..........................................................................................................................
Error 3 .......................................................................................................................................
..........................................................................................................................
Error 4 .......................................................................................................................................
.......................................................................................................................... [4]
(c) Show how you would change the corrected algorithm to only total numbers greater than 0 and
.......................................................................................................................... ..................................................
........................................................................................... [2]
pseudocode. .......................................................................................................................................................
............................................................................................................................................ ................................
.......................................................................................................................... ..................................................
........................................................................................................ ....................................................................
................................................................................ [3]