78.7k views
2 votes
Help please! The following code segment is used to determine whether a customer is eligible for a discount on a movie ticket.

val1 ← (NOT (category = "new")) OR (age ≥ 65)


val2 ← (category = "new") AND (age < 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?


val1 = true, val2 = true

val1 = true, val2 = false

val1 = false, val2 = true

val1 = false, val2 = false

User Gecco
by
7.7k points

1 Answer

4 votes
If the category is "new" and the age is 20, the values of val1 and val2 as a result of executing the code segment would be:

val1 = true
val2 = false

So the correct answer is:
val1 = true, val2 = false
User Stefan Luv
by
8.2k points