Figure 5 shows an algorithm represented using pseudo-code - AQA - GCSE Computer Science - Question 6 - 2023 - Paper 1
Question 6
Figure 5 shows an algorithm represented using pseudo-code.
The algorithm is for a simple authentication routine.
The pseudo-code uses a subroutine getPassword to c... show full transcript
Worked Solution & Example Answer:Figure 5 shows an algorithm represented using pseudo-code - AQA - GCSE Computer Science - Question 6 - 2023 - Paper 1
Step 1
L1 USERINPUT
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
This line indicates that the algorithm accepts input from the user for the username.
Step 2
L2 username
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Here, the variable 'username' is initialized as an empty string to store the user-provided username.
Step 3
L3 ''
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
This section handles the condition where no password is provided initially and thus also initializes it as an empty string.
Step 4
L4 User not found
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
In this part, the algorithm responds with 'User not found' if the entered username does not exist in the system.