Task 18 proved to be a very interesting design challenge. We ended up with a design that required lots of IF..ELSE statements.
Tag: or
S3 – Conditional Loops
A conditional loop is used to repeat part of the program until a condition is true.
The program shown here is a password checker. The program will exit the loop if the user guess is 1233 or the user has had 3 attempts. This uses a complex conditional statement with the logical operator OR, the OR logical operator returns a true value when one of the conditions are true.
The final IF statement checks if the user has entered the correct password before saying welcome.