pseudocode
For practice we had to create pseudocode. Below is my pseudocode.
PROMPT for username
IF user types “quit”
Exit Program
ELSE
ENDIF
PROMPT for password
IF user types “quit”
Exit Program
ELSE
ENDIF
VALIDATE user input
IF NOT Validated
Check number of invalid entries
IF failed attempts is equal to three
DISPLAY error message
EXIT program
ELSE
DECREMENT remaining attempts by one
DISPLAY remaining attempts
LOOP to VALIDATE user input
ENDIF
ELSE
SET username
MATCH user role
DISPLAY welcome message
A class mate recommended I add a while loop that looks like this:
WHILE exit is false THEN
GET username
GET password
IF password and username do NOT equal the exit flag (the user types exit or perhaps a menu option to exit) THEN
// perform the credential authentication here…
ELSE
SET exit to true
ENDIF
ENDWHILE
I didn’t the chance to ask him but I’m new to this and I’m having a hard time understanding where that would go in my current pseudocode?
Hope this makes sense!
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"
