Note AcademyNote Academy

Computer Science · Oct / Nov 2024 · Paper 21 · Question 8

0478

As printed in the paper

The question as text

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, «¬­­®¯°± • check if there are at least 8 characters in the password • check that the password is not the same as the stored password ˜²±«¬­­ • output ‘accepted’ if both tests are completed successfully • otherwise, output ‘rejected’. Use the variable names given.

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 8(a)[6]

    One mark for:

    START

    correct use of flowchart symbols
    working flowlines
    input correct

    INPUT Password

    working length check
    working comparison
    correct output messages

    No

    IS Length

    Password >= 8 ?

    Yes

    No

    IS Password <>

    OldPass?

    Yes

    OUTPUT

    OUTPUT

    "accepted"

    "rejected"

    STOP

  • 8(b)[3]

    One mark for each point

    OPENFILE MyPassword.txt FOR WRITE
    WRITEFILE MyPassword.txt, Password
    CLOSEFILE MyPassword.txt
  • 8(c)[2]

    One mark for each point

    needs to be retrieved on demand // saved for a later date
    storage must be non-volatile

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.