ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions

N5 Computing Science 2014 Question 18

10 marks · Selection and logical operators

Identify the line that includes a condition. Line Identify the line that stores a value in an array. Line Identify the line that accepts input values into the program. Line When the code for the program is written the programmer mis-types the word UNTIL, typing UNTOL instead. State the type of programming error being described above. The pseudocode is edited to ensure that the new weight being entered is acceptable. .... Line 16 REPEAT Line 17 RECEIVE newWeight FROM (REAL) KEYBOARD Line 18 UNTIL newWeight > 20 AND newWeight < 70 ...... State the type of loop shown above. State an input the user could enter to enable the program to continue from line 18. State another design notation that could have been used to design the app. While the program is being implemented, the programmer stops occasionally to run the program. State the type of translator you would recommend the programmer uses in this situation. Explain your answer. Translator Explanation State the component required to convert the data from the mobile devices touchscreen into data that can be used by the app. An athlete is developing a mobile application (app). The app will allow athletes to track weight in Kg. Part of the pseudocode for this app is shown below. ...... ..... Line 15 SEND “Enter your new weight” TO DISPLAY Line 16 RECEIVE newWeight FROM (REAL) KEYBOARD Line 17 IF newWeight > previousWeight [counter] THEN Line 18 SEND [“You have gained weight”] TO DISPLAY Line 19 END IF Line 20 SET previousWeight [counter] TO newWeight .... .....

Marking scheme

17 20 16 Syntax Conditional (loop) Real number >20 and <70 Structure Chart Structure Diagram Flow Chart 1 mark for any other contemporary design notation. Interpreter (1 mark) No need to leave the programming environment/tracing facilities/debugging facilities (1 mark) Note that both interpreters and compilers translate code one line at a time and return errors. Candidates answer must go further to distinguish between the two. Interface

Previous question: N5 Computing Science 2014 Question 17

Next question: N5 Computing Science 2014 Question 19