ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions
2 marks · Testing
The code below should receive input and display a user’s name. … Line 3 DECLARE name INITIALLY "" Line 4 SEND "Please type in your name" TO DISPLAY Line 5 SD "Your name is" & name TO DISPLAY Line 6 RECEIVE name FROM KEYBOARD … Identify the syntax error and logic error in the program code above. Syntax error Logic error
One mark each for • Syntax error — SD (should be SEND) • Logic — The name is displayed before the user enters it For the logic error accept, Line 6 should come after line 4.