Problemas
The following code segment is used to determine whether a customer is eligible for a discount on a movie ticket. val1arrow (NOT (category="new^n)) oR (age geqslant 65) val2arrow (category="new') AND (age lt 12) If category is "new" and age is 20, what are the values of val1 and val2 as a result of executing the code segment? A val1=true, val2=true B val1=true, val2=false C val1=false, val2=true D va11=false, val2=false
Roztwór
Alessandra
maestro · Tutor durante 5 años
4.4
(110 Votos)
Respuesta
Let's break down the code segment step by step:1. **Initialization of
**: - The expression for
is:
- Given:
- Evaluate the expression:
- Combine the results using OR:
2. **Initialization of
**: - The expression for
is:
- Given:
- Evaluate the expression:
- Combine the results using AND:
Therefore, the values of
and
are:
So, the correct answer is:(D)