Questions Paper 1 Flashcards
7.1 Shade one lozenge to show which programming technique is used on line 3 of the algorithm
C. Selection
7.2 Shade one lozenge to show the data type of the variable ans in the algorithm
D. string
7.3 State how many output instructions will execute whenever the algorithm is run.
Three
7.4 State the two possible sequences of user input that would result in ‘Contact supplier’ being output.
‘no’ followed by ‘yes’
‘yes’ followed by ‘yes’
7.5 Explain why this problem has occured and describe what would happen if a user entered ‘y’ or ‘n’ instead of ‘yes’ or ‘no’
The output message is not very clear, line 3 will only be true if they enter ‘no’ and line 6 and 14 will only be true if they enter ‘yes’
- Complete the algorithm in pseudo-code
IF image1 [i][j] = image2 [i][j] THEN (A,B,C0
inverse