ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions
2 marks · Selection and logical operators
Identify the line containing a logic error. Line State how this error should be corrected. Employees can only access their company network if they enter a correct username and password. A validation program is being developed and will run each time an employee logs on. An extract of pseudocode from the program is shown below. Line 1 RECEIVE userName FROM (STRING) KEYBOARD Line 2 RECEIVE pinNumber FROM (STRING) KEYBOARD Line 3 IF userName VALID OR pinNumber VALID THEN Line 4 Allow access to network Line 5 ELSE Line 6 SEND “Access Denied” TO SCREEN Line 7 END IF An error is noticed when the program is tested.
3 Replace OR with AND