The VIP Gate
EasyAcc. 93.5%
+20 XP 8
The Double Lock
For high-security operations, one key isn't enough. You need the Logical AND (&&) operator to ensure that both conditions are true at the same time. If even one condition is false, the entire door remains locked.
The Assignment
Your function receives parameters hasTicket and isLate.
- Use
if-elsewith logical operators:- If the user
hasTicketAND is NOTisLate, print: "Gate is open. Proceed." - Otherwise, print: "Entry denied."
- If the user
01EXAMPLE 1
Input
hasTicket = true, isLate = falseOutput
Logs: "Gate is open. Proceed."Explanation: Both conditions are met.
02EXAMPLE 2
Input
hasTicket = true, isLate = trueOutput
Logs: "Entry denied."Explanation: Even with a ticket, the user is late.
Constraints
- Use the && operator and the ! (NOT) operator.
- Log messages must match exactly.
Control FlowConditionalsLogic
JavaScriptSystem handles I/O — write your function only
Loading...
4 Hidden
Input Arguments
hasTickettrue
isLatefalse
Expected Output
Gate is open. Proceed.
Click RUN to test your solution