0% found this document useful (0 votes)
3 views

Unit_7_8_Worksheet 1 1

Uploaded by

ben63forcee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Unit_7_8_Worksheet 1 1

Uploaded by

ben63forcee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Unit 7 – Algorithm Design and Problem Solving

Unit 8 – Programming -- Worksheet 1


Grade: 9
Name of the Student:Vasegaran MR

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

Correction ................................................................................................................................. .........................

..........................................................................................................................

Error 2 .......................................................................................................................................

Correction ................................................................................................................................. .........................

..........................................................................................................................

Error 3 .......................................................................................................................................

Correction ................................................................................................................................. .........................

..........................................................................................................................

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]

4 An algorithm is written in pseudocode:

(a) Describe the purpose of the

algorithm. ..............................................................................................................................................

..... ................................................................................................................................................... ......

............................................................................................................................................. ..................

................................................................................................................................. ..............................

..................................................................................................................... ..........................................

.....................................................................................................[3]

(b) Re-write the algorithm in pseudocode using a different type of

loop. ................................................................................................................................................... ...

................................................................................................................................................ ...............

.................................................................................................................................... ...........................

........................................................................................................................ .......................................
............................................................................................................ ...................................................

................................................................................................ ...............................................................

.................................................................................... ...........................................................................

........................................................................ .......................................................................................

............................................................ ...................................................................................................

............................................[3]

(c) Describe how you could modify the original algorithm shown at the start of question 4, to allow any

number of

inputs. ................................................................................................................................................... ......

............................................................................................................................................. ........................

........................................................................................................................... ..........................................

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

Correction ................................................................................................................................. .........................

..........................................................................................................................

Error 2 .......................................................................................................................................

Correction ................................................................................................................................. .........................

..........................................................................................................................

Error 3 .......................................................................................................................................

Correction ................................................................................................................................. .........................

..........................................................................................................................

Error 4 .......................................................................................................................................

Correction ................................................................................................................................. .........................

.......................................................................................................................... [4]

(c) Show how you would change the corrected algorithm to only total numbers greater than 0 and

less than 20.


................................................................................................................................................... .........................

.......................................................................................................................... ..................................................

........................................................................................... [2]

7 Name the three types of loop structure used in

pseudocode. .......................................................................................................................................................

... .......................................................................................................................................................... ..............

............................................................................................................................................ ................................

.......................................................................................................................... ..................................................

........................................................................................................ ....................................................................

................................................................................ [3]

You might also like