Page 1080 - SUBSEC October 2017_Neat
P. 1080

- 9 -
                                                                                 01229020/KMS/SPEC 2017

                                               Information Technology
                                          Paper 02 – General Proficiency
                                                 Key and Mark Scheme
                                                    SPECIMEN PAPER

              SO     Question                                      Key                                     Mark
                    4. cont’d
                    (d)           Begin
                                                 Declare number, sum, average, count [1]
                                           count=0
                                           sum=0
                                           print “Please enter….”
                                           read number
                                           while(number!=-1)
                                               sum=sum+number
                                               count=count + 1
                                               read number
                                           end while
                                           count=count+1
                                           read number                                                      10
                                           end while
                                           print “sum=”, sum
                                           print “average=” sum/count
                                                   End

                                  Declare appropriate variable [1 mark]
                                  Initialise the variable [1 mark]
                                  Read first value [1 mark]
                                  Loop control condition [2 marks]
                                  Statements in loop [3 marks]
                                  Print Sum [1 mark]
                                  Print Average [1 mark]

                    (e)           The algorithm allows the user to enter 10 numbers [1]
                                  after which it displays the smallest of the numbers
                                  entered [1]                                                (2 marks)

                                  It does this by checking each number entered to see if
                                  it is smaller that the smallest number received thus                       5
                                  far. [1] If it is, then that number is recorded as the
                                  smallest number by storing it in the variable selected.
                                  [1] When the program exits the loop any value stored in
                                  the variable selected will be the smallest [1] – so it
                                  is displayed using the print statement.                    (3 marks)

                                                                                                 TOTAL      25
   1075   1076   1077   1078   1079   1080   1081   1082   1083   1084   1085