Popcorn Hack #1
A washing machine will only start the washing cycle if the door is closed AND the start button is pressed. This is good ot improve safety, since it will only start when both requirnments are met and the waishng machine is in a safe status.
Popcorn Hack #2
A, (X AND Y) OR Z is correct.
The circuit outputs 1 if either: X AND Y are both 1, or Z is 1.
This matches the expression: (X AND Y) OR Z
So, the correct answer is A.
Homework Hack
def secure_entry_system(keycard, pin, voice_auth):
def AND(a, b):
return a & b # AND logic
return AND(AND(keycard, pin), voice_auth)
# Test cases
print(secure_entry_system(1, 1, 1)) # Expected Output: 1 (Access Granted)
print(secure_entry_system(1, 1, 0)) # Expected Output: 0 (Access Denied)
print(secure_entry_system(1, 0, 1)) # Expected Output: 0 (Access Denied)
print(secure_entry_system(0, 1, 1)) # Expected Output: 0 (Access Denied)
1
0
0
0