want to know what u thing???
name: sara name:miky name:ducky
code:1345X code:2238Y code:7569Z
IF THE USER ENTERS WRONG NAME THE SYSTEM ASKS TO RE-ENTER. THE SYSTEM ONLY ALLOWS THREE CONSECTIVE ATTEMPTS.AFTER CORRECT NAME ENTERED THE SYSTEM ASKS FOR ALPHANUMERIC CODE WHICH AGAIN SYSTEM ALLOWS ONLY THREE CONSECTIVE ATTEMPTS. IF THE NAME AND CODE CORRECTLY ENTERED THE SYSTEM DISPLAYS 'THE DOOR IS NOE OPEN' IF THIS IS NOT THE CASE AND ALL THREE ATTEMPTS FAIL THE SYSTEM DIAPLAYS 'PLEASE SEEK ASSISSTANCE'
I UNDERSTAND THAT WE HAVE TO USE DOWHILE LOOP BUT PLEASE EXPLAIN ABIT MORE HOW SHOULD I DO IT. AND ALSO THE NAME MUST BE ENTERED IN LOWER CASE FOLLOWED BY A SAPCE. WHAT SHOULD I DO HERE?
here is my pseudocode
PROMPT "Please enter your code"
GET code
while (namemike 1345X AND namekaren 2238Y AND namekulie 7569Z AND attempts <= 3)
Display "Enter your name";
name = read name from console;
if enteredName==correctName
isCorrectName=true
break from the while loop
else
add 1 to attempts
end while
if (attempts > 3)
console: "Seek assistance"
exit to the system
attempts = 0;
enteredcode==correctCode;
isCorrectCode=true
while (attempts <= 3)
Display "Enter your code";
enteredcode==correctCode;
if code entered and correct code are equal
Display "the door is now opened"
break from the while loop or exit here
else
add 1 to attempts
end while