Page 1067 - SUBSEC October 2017_Neat
P. 1067

- 16 -



                    (d)    Algorithms are used to express the steps required to solve a problem.  Write an algorithm
                           using simple pseudocode to do the following


                           •   Prompt a user by displaying the following statement:

                               Please enter positive integers one at a time and “–1” to indicate no further input.

                           •   Accept the values from the user until –1 is entered                                     DO NOT WRITE IN THIS AREA


                           •   Determine and display

                               (i)  the sum of the numbers

                               (ii) the average of the numbers.


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

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

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

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


                           ..............................................................................................................................................  DO NOT WRITE IN THIS AREA

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

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


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

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

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

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


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

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

                           ..............................................................................................................................................  DO NOT WRITE IN THIS AREA


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

                           ............................................................................................................................................
                                                                                                  (10 marks)



                                                                              GO ON TO THE NEXT PAGE
              01229020 SPEC/2017
                                                       ‘‘*’’Barcode Area”*”
                                                       Sequential Bar Code
   1062   1063   1064   1065   1066   1067   1068   1069   1070   1071   1072