national qualifications cs(n5)15a! computing science · doublestack(n) after the code has finished...

25
FOR OFFICIAL USE National Qualifications Mark CS(N5)15A Computing Science Duration — 1 hour and 30 mins Fill in these boxes and read what is printed below. Full name of centre Town Forenames(s) Surname Number of seat Date of birth Day Month Year Scottish candidate number D D M M Y Y Total marks – 90 SECTION 1 – 20 marks Attempt ALL questions in this section. SECTION 2 – 70 marks Attempt ALL questions in this section. Read all questions carefully before attempting. Write your answers in the spaces provided, using blue or black ink. Show all workings. Before leaving the examination room you must give this booklet to the invigilator. If you do not, you may lose all marks for this paper. © 2014 Perfect Papers – All rights reserved

Upload: others

Post on 13-Jun-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

  FOR OFFICIAL USE      

 

             

National Qualifications  

   

Mark    

     

              CS(N5)15A   Computing Science    

      Duration — 1 hour and 30 mins     Fill in these boxes and read what is printed below.     Full name of centre Town  

 

 

  Forenames(s) Surname Number of seat  

 

  Date of birth   Day Month Year Scottish candidate number

 D D M M Y Y

    Total marks – 90     SECTION 1 – 20 marks

  Attempt ALL questions in this section.

    SECTION 2 – 70 marks

  Attempt ALL questions in this section.

    Read all questions carefully before attempting.

  Write your answers in the spaces provided, using blue or black ink.

  Show all workings.

  Before leaving the examination room you must give this booklet to the invigilator. If you do not, you may lose all marks for this paper.

   

          © 2014 Perfect Papers – All rights reserved

   

Page 2: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page two

          MARKS DO NOT

WRITE IN THIS

MARGIN

  SECTION 1 – 20 marks     Attempt ALL questions     1. Paul is viewing a webpage on his tablet computer. Name the software on

Paul’s tablet computer that allows him to do this. 1

          2. Explain how phishing is used to compromise the security of a user’s accounts. 2                     3. Calculate the backing storage required for a 16-bit colour image 640 pixels by

480 pixels.

    Express you answer in Kilobytes. 3                                             4. Name the part of the processor that temporarily stores values while they are

being processed. 1

           

   

Page 3: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page three

          MARKS DO NOT

WRITE IN THIS

MARGIN

  5. Convert the decimal value 52 into the equivalent 8-bit binary number. 1                       6. Individuals, organisations and businesses are making use of cloud services to

store data.

    Explain two possible risks of using cloud services. 2                           7. Explain how an interpreter translates high-level language program code into

machine code. 3

                          8. State which system bus is used to select memory locations for reading or

writing. 1

                 

   

Page 4: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page four

          MARKS DO NOT

WRITE IN THIS

MARGIN

  9. A computer program has the following lines of code.     Line 1 SET size TO 3

Line 2 SET height TO 2

Line 3 SET result TO size ^ height

    Explain how result will be calculated when line 3 is executed. 2                       10. This pseudocode allows a user to enter a capital letter from “A” to “F” when

making a choice from a menu program.

    Line 1 RECEIVE choice FROM (STRING) KEYBOARD

Line 2 WHILE choice < “A” OR choice > “F” DO

Line 3 SEND “Error: Re-enter choice A to F” TO DISPLAY

Line 4 RECEIVE choice FROM (STRING) KEYBOARD

Line 5 END WHILE

    Explain what happens if a user enters “G”. 2               11. A police service employee has lost a laptop storing details of confidential

police cases.

    (a) Identify one security precaution that would prevent unauthorised access

to the details on the laptop. 1

        (b) Identify one other security precaution that would ensure that the details

were unreadable even if the laptop was accessed. 1

         

   

Page 5: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page five

          MARKS DO NOT

WRITE IN THIS

MARGIN

  SECTION 2 – 70 Marks     Attempt ALL questions     12. Sally has been asked to design a program to calculate the wages to be paid to

workers in a small business. The program will store the hourly rate of pay, the number of hours worked, the number of overtime hours. Overtime hours are paid at twice the hourly rate of pay. The following calculations will be used to output the wages for each worker. Standard Wages = Hourly Rate * Number of Hours Worked Overtime Wages = Hourly Rate * Overtime Hours * 2 Total Wages = Standard Wages + Overtime Wages

    (a) State the number of variables Sally would require in this program. 1         (b) Using pseudocode or a programming language of your choice, write a

program to enter the required data, then calculate and display the total wages for a worker. 5

    Pseudocode OR Programming Language                                                        

   

Page 6: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page six

         

12. (continued) MARKS DO NOT

WRITE IN THIS

MARGIN

    (c) Sally changes the program to ensure that hourly rate can only be

entered as always greater than or equal to £10 and less than or equal to £22.

    (i) State the standard algorithm that is used to ensure that data

entered is acceptable. 1

        (ii) Complete the table below to show four different examples of test

data for hourly rate and the type of each example. 3

    Test Data Type of Test Data   15.45 normal

  9.99

  10.00

  extreme

    Total marks 10                                                          

   

Page 7: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page seven

         

MARKS DO NOT

WRITE IN THIS

MARGIN

  13. The Fintry Hockey League are organising the teams and players for this years hockey competition. The Fintry Hockey League want to store the details of the teams and the players in those teams.

    Some sample data is shown in the table below.     Team

ID Team Name

Home Pitch

PlayerID Player Name

Position Fees paid

  621 Methlick Marvels Methlick MUGA 121 J. Smith Goalie Yes   621 Methlick Marvels Methlick MUGA 122 M. Braoca Sweeper Yes   621 Methlick Marvels Methlick MUGA 123 W. Carson Fullbacker No   162 Comers Comets Logie 145 Q. Blake Right Wing Yes   162 Comers Comets Logie 146 B. Hope Inner Yes   120 Lossie Lions Huntly 147 H. Lecter Left Wing No   120 Lossie Lions Huntly 162 J. Jamieson Goalie Yes   772 Stoney Stoats Stonehaven 163 B. Pitt Midfielder No   772 Stoney Stoats Stonehaven 165 J. Lennon Goalie Yes     (a) To avoid data duplication, a database with two linked tables is

suggested.

    (i) List the fields/attributes that should be included in each table. 2     TEAM table PLAYER table                           (ii) Identify the foreign key used to link the two tablets. 1         (b) The “Fees Paid” column is used to indicate if a player has paid the

annual subscription to the league.

    Name the field type required to store this data.     1            

 

   

Page 8: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page eight

 

          MARKS DO NOT

WRITE IN THIS

MARGIN

13. (continued)     (c) There are eleven possible values for the Position that a player can have.     Name the type of validation that should be implemented on this field. 1         (d) The Fintry Hockey League has a mobile app. The app displays the teams

and player positions for each game. A screenshot of the app is shown below:

   

    (i) Identify one feature that makes this a suitable interface for a

mobile app. 1

        (ii) When a user selects the Players button on the app, a list of players

for that team is shown.

    Describe what happens within the database when this button is

selected. 2

                         

   

Page 9: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page nine

          MARKS DO NOT

WRITE IN THIS

MARGIN

13. (continued)     (e) Another screen from the app is shown below.    

    Identify two features used on this screen to aid navigation. 2                 Total marks 10                        

   

Page 10: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page ten

          MARKS DO NOT

WRITE IN THIS

MARGIN

  14. A programmer is developing a game. The code below is used to animate a

character that moves across the bottom of the screen.

    ……

……

Line 21 SET SpriteFrame TO 1

Line 22 SET SpriteX TO 0

Line 23 SET SpriteY TO 0

Line 24 SET SpriteMove to 10

Line 25 REPEAT

Line 26 SET SpriteImg TO SpriteFrames[SpriteFrame]

LINE 27 RECEIVE keypress FROM (STRING) KEYBOARD

Line 28 IF keypress = “D” THEN

Line 29 SET SpriteX TO SpriteX + SpriteMove

Line 30 END IF

……

……

    (a) (i) Identify a line that includes a condition. 1     Line     (ii) Identify a line that reads a value from an array. 1     Line     (iii) Identify the line that accepts input values into the program. 1     Line     (b) (i) The above code was initially designed using pseudocode. Name

another design notation.

    1     (ii) Describe one advantage of using this design notation rather than

pseudocode. 1

                 

   

Page 11: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page eleven

          MARKS DO NOT

WRITE IN THIS

MARGIN

14. (continued)     (c) When the code for the program is written the programmer mis-types the

word REPEAT, typing RPEEAT instead.

    State the type of programming error described above. 1         (d) The pseudocode is edited to ensure that only the valid keys for

controlling the game are accepted.

    ……

Line 27 REPEAT

LINE 28 RECEIVE keypress FROM (STRING) KEYBOARD

LINE 29 UNTIL keypress = “A” OR keypress = “S”

    (i) State the type of loop shown above. 1         (ii) Explain why OR is used in the code above rather than AND.                     2       (e) The game is converted to a tablet app. State the component required to

convert the data from the tablet touchscreen into data that can be used by the app. 1

                                                                                                                             

 

   

Page 12: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page twelve

 

          MARKS DO NOT

WRITE IN THIS

MARGIN

  15. Burtons is an online supplier of Car and Cycling equipment and has a very

successful web site developed for customers using desktop and laptop computers.

               

   

   

              (a) The site is difficult to access with tablet and mobile devices.     Identify two reasons why the webpage above would be unsuitable for

tablet and mobile devices. 2

    Reason 1         Reason 2                                  

 

   

Page 13: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page thirteen

 

          MARKS DO NOT

WRITE IN THIS

MARGIN

15. (continued)     (b) Burtons have decided not to develop a mobile application (app) for use

on tablet and mobile devices. Instead, Burtons have chosen to develop a mobile friendly version of the web site.

    Explain two advantages of creating a mobile friendly web site rather

than developing a mobile app. 2

                        (c) When shopping on the site, the connection between the customer’s

browser and the site server is encrypted.

    Explain how encryption protects the data sent between the browser and

the server. 2

                                                       

 

   

Page 14: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page fourteen

 

          MARKS DO NOT

WRITE IN THIS

MARGIN

  15. (continued)     (d) The mobile friendly version of the site is shown below. The site has been

designed to make use of the features of mobile devices.

   

    Identify two mobile input devices that would allow users to make use of

the search features of this site. 2

            (e) Mobile devices make use of both RAM and ROM.     (i) State what RAM stands for.             (ii) State what ROM stands for.           Total Marks 10  

 

   

Page 15: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page fifteen

 

          MARKS DO NOT

WRITE IN THIS

MARGIN

  16. A programming language, used to control an industrial robot, provides the

following pre-defined functions.

    stack(a, b ) – moves the box at Position a to Position b   move (b, c) – moves a stack of items at Position a to Conveyer belt c.   count(b) - counts the number of boxes at Position b     These can be used by the programmer to create stacks of boxes and push them

to the correct conveyor belt. Note: When a box is picked up, to be stacked, a new box automatically replaces it in that position. A programmer writes the code to stack boxes a certain number (n) high and push the stack to a specified conveyor belt.

   

PackPushZ(n) REPEAT (n-1) TIMES stack(“R”, “T”) END REPEAT move(“T”, “Z”)

Starting position

After the END REPEAT statement

After move(T,Z)

               

               

 

   

Page 16: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page sixteen

 

 

          MARKS DO NOT

WRITE IN THIS

MARGIN

16. (continued)     (a) Write the code that would create two stacks, one in position R and the

other in position T. When complete Position T is pushed to Conveyor belt Z and Position R is pushed to Conveyor Belt X. All blocks are picked up from Position S. Assume the same starting position as shown on the previous example. 3

    DoubleStack(n) After the code has finished the stacks/boxes will be:  

    (b) Describe one way you could make the programmer’s code more readable. 1         (c) Suggest a new pre-defined function that could be added to this

programming language. 1

        (d) Code is added to each function to ensure that stacks of over 5 boxes at

Position R are automatically pushed to the nearest Conveyor belt. Two values have been missed from the code. Complete the code by filling in the missing values in the two boxes. 2

    IF count( ) > 5 THEN

    move(“R”, )

  END IF

             

 

   

Page 17: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page seventeen

 

          MARKS DO NOT

WRITE IN THIS

MARGIN

  16. (continued)     (e) The design diagrams used by the programmer were created as vector

graphics.

    Describe how a rectangle would be saved as a vector graphic. 2                 (f) All activities and products, such as the use of these industrial robots,

have a carbon footprint.

    Explain what is meant by carbon footprint. 1             Total marks 10                                                        

 

   

Page 18: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page eighteen

          MARKS DO NOT

WRITE IN THIS

MARGIN

  17. Minewars is an online survival crafting game. It has a wiki which players use to

share information and tips about the game.

    (a) A player of the game creates the following pages in the wiki.    

    (i) Referring to the designs above, draw a diagram to represent the

navigation structure for the Minewars Crafting Recipes. 2

                    (ii) The hyperlinks are checked to make sure each one leads to the

correct page in the wiki.

    Describe one other test that should be carried out on the wiki web

pages. 1

            (iii) The Minewars wiki uses internal and external hyperlinks.     Explain the difference between an internal hyperlink and an

external hyperlink. 2

                     

 

   

Page 19: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page nineteen

 

          MARKS DO NOT

WRITE IN THIS

MARGIN

17. (continued)     (b) Another page on the MineWars Wiki is shown below.    

    What is the URL of this web page? 1         (c) The webpage is created using HTML and JavaScript.     (i) State the feature of HTML code that allows the webpage to be

formatted. 1

               

 

Page 20: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page twenty

          MARKS DO NOT

WRITE IN THIS

MARGIN

17. (continued)     (c) (ii) The “Search” feature uses JavaScript to show possible search

terms as the user types.

    Suggest one other use of JavaScript that could be added to this

webpage. 1

            (d) The wiki web site includes a variety of media types which are stored

using several standard file formats.

    Complete the table below, indicating where the following file formats

have been used on the website.

    The first one has been done for you. 2     File Format Example  

pdf

Article download

  mp3

  png

    Total marks 10                                            

 

Page 21: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page twenty-one

          MARKS DO NOT

WRITE IN THIS

MARGIN

  18. Rohan is at Livingston airport and is looking at the Departures app that shows

status information about the flights leaving the airport.

    Airline Time Flight To Status  

20:20 EZY812 GATWICK GATE CLOSED 2010

 

20:20 BE856 BIRMINGHAM TAXIED 2017

 

20:30 EZY488 BELFAST INTL LAST CALL 2035

 

20:30 FR819 DUBLIN LAST CALL 2035

 

20:35 BA1465 HEATHROW GATE OPEN 2050

 

20:45 EZY020 LUTON GATE OPEN 2055

 

21:10 DY1355 OSLO SCHEDULED

 

21:40 EZY430 BRISTOL SCHEDULED

 

21:45 EZY814 GATWICK ESTIMATED 0040

    The app updates the information on display every 60 seconds. If Rohan taps a

specific flight details of that flight and route are displayed within the app. Each of the airline logos is linked to the airline websites. Tapping any one of the column headings sorts the data on that column.

    (a) Identify a situation in the Departures app where the programmer

implemented the following programming constructs. 2

   

Repetition

  Selection

                             

 

Page 22: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page twenty-two

          MARKS DO NOT

WRITE IN THIS

MARGIN

Q18. (continued)     (b) When the program was developed, the programmer had a choice of the

following images to use for the “flybe” logo.

   

flybe-1

Image Properties: Mime Type: image/jpeg Dimensions: 83 pixels x 24 pixels File size: 14.3 KB Bit depth: 8 bit

 

flybe-2

Image Properties: Mime Type: image/bmp Dimensions: 83 pixels x 24 pixels File size: 26.3 KB Bit depth: 16 bit

    Explain why flybe-1 was used in the app rather than flybe-2. 2                     (c) The app allows Rohan to search for and display flights to specific

destinations from Livingston and other local airports. Here are some search results that Rohan has requested.

    From   Resort Departs Price  per  person   Livingston   Rome 29/05/2015 £225·∙00   Dundee   Rome 02/07/2015 £189·∙00   Glasgow Rome 16/08/2015 £125·∙00   Livingston   Paris 12/05/2015 £250·∙00   Dundee Paris 22/06/2015 £189·∙00   Glasgow   Madrid 02/07/2015 £195·∙00   Dundee Madrid 20/08/2015 £125·∙00   Glasgow Halkidiki 03/07/2015 £150·∙00   Livingston Barcelona 02/06/2015 £295·∙00   Livingston Athens 12/06/2015 £110·∙00   Livingston Athens 19/06/2015 £189·∙00     Describe how this list is sorted. 2                  

 

Page 23: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page twenty-three

[B  

          Q18. (continued) MARKS DO NOT

WRITE IN THIS

MARGIN

  (d) Rohan thinks there is a logic error in the app and has reported it. When a

flight is cancelled the status is being incorrectly shown as “SCHEDULED”

    Airline Time Flight To Status  

20:45 EZY020 LUTON GATE OPEN 2055

 

21:10 DY1355 OSLO SCHEDULED

    In the example above SCHEDULED should be CANCELLED. The code this is

shown below.

    ……

Line 252 IF NOT(status = “CANCELLED”) THEN

Line 253 SEND status, status_time TO SCREEN

Line 254 ELSE

Line 255 SEND “SCHEDULED” TO SCREEN

Line 256 END IF

    (i) Identify the line containing a logic error. 1     Line     (ii) State how this error should be corrected. 1             (e) An execution error is also found in the program.     (i) Explain what an execution error is. 1               (ii) Describe an example cause of an execution error. 1                 Total marks 10    

Page 24: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page twenty-four

 

          MARKS DO NOT

WRITE IN THIS

MARGIN

  ADDITIONAL SPACE FOR ANSWERS                                                                                                    

Page 25: National Qualifications CS(N5)15A! Computing Science · DoubleStack(n) After the code has finished the stacks/boxes will be: ! ! ! (b) Describe one way you could make the programmer’s

Page twenty-five