Pseudocode

Pseudocode will be used as the formal method of describing algorithms in the 2025 v1.2 Digital syllabus. It is a descriptive method used to represent an algorithm and is a mixture of everyday language and programming conventions. Pseudocode is often an intermediate step in programming between planning and writing executable code.

Pseudocode does not have a standard format and varies between programmers; however, algorithms must be able to be understood by anyone independent of a particular programming language. When students use pseudocode, they should:

The following pseudocode demonstrates examples of assignment (DECLARE), sequence, condition (IF), selection (THEN), iteration (WHILE), modularisation (FUNCTION, CALL), indentation and two variations of case (UserLogin, userName) for a user authentication process:

FUNCTION UserLogin(): DECLARE userName, userPassword AS STRING DECLARE loginAttempts AS INTEGER = 3 OUTPUT "Welcome to Login System." WHILE loginAttempts > 0 INPUT "Enter username:" -> userName INPUT "Enter password:" -> userPassword IF IsValid(userName, userPassword) THEN OUTPUT "Login successful!" ShowDashboard() RETURN END IF loginAttempts -= 1 OUTPUT "Invalid. " & loginAttempts & " attempts left." END WHILE OUTPUT "Try again later." END FUNCTION FUNCTION IsValid(user, pass) AS BOOLEAN: RETURN user = "admin" AND pass = "password123" END FUNCTION FUNCTION ShowDashboard(): OUTPUT "Welcome to Dashboard." END FUNCTION CALL UserLogin()