Question 8(b) 2024 · October-November · Paper 21 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 8
Part (b)
Question 3
- OPENFILE MyPassword.txt FOR WRITE
- WRITEFILE MyPassword.txt, Password
- CLOSEFILE MyPassword.txt
Show text version of question
Question 8
Part (b)
Question 8
A programmer is designing a program to check the length of a password and to check if the
password input is the same as the stored password.
The program requirements are:
- input the password, Password
- check if there are at least 8 characters in the password
- check that the password is not the same as the stored password OldPass
- output ‘accepted’ if both tests are completed successfully
- otherwise, output ‘rejected’.
Use the variable names given.
Part (b)
The accepted password, Password, is to be written to the file MyPassword.txt
Write pseudocode to:
- open the file
- write the accepted password to the file
- close the file.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Why this question appears here
64% assigned-topic match · Programming › Programming concepts
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 0478_w24_qp_21.pdf
