Challenge: Access and Perks Checker
Swipe to start coding
You're validating user access and perks during checkout. All inputs are pre-initialized. Do not change them. Fill in the expressions to compute the results below using only variables, operators (==
, !=
, <
, <=
, >
, >=
, and
, or
, not
), and parentheses.
Compute:
-
is_adult
: user is at least the adult age. -
can_enter
: user can enter only if they have ID and are an adult. -
qualifies_free_shipping
: qualifies if the purchase total meets the free-shipping threshold or the user is a member. -
eligible_discount
:- Members: discount if
purchase_total >= member_min_spend
- Non-members: discount if
purchase_total >= guest_min_spend
- Members: discount if
-
needs_manual_review
: review is needed if email is not verified or phone is not verified. -
valid_score_range
: the score is within inclusive bounds using chained comparison.
Lösning
Tack för dina kommentarer!
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Can you explain this in simpler terms?
What are the next steps I should take?
Can you give me an example?
Awesome!
Completion rate improved to 5
Challenge: Access and Perks Checker
Svep för att visa menyn
Swipe to start coding
You're validating user access and perks during checkout. All inputs are pre-initialized. Do not change them. Fill in the expressions to compute the results below using only variables, operators (==
, !=
, <
, <=
, >
, >=
, and
, or
, not
), and parentheses.
Compute:
-
is_adult
: user is at least the adult age. -
can_enter
: user can enter only if they have ID and are an adult. -
qualifies_free_shipping
: qualifies if the purchase total meets the free-shipping threshold or the user is a member. -
eligible_discount
:- Members: discount if
purchase_total >= member_min_spend
- Non-members: discount if
purchase_total >= guest_min_spend
- Members: discount if
-
needs_manual_review
: review is needed if email is not verified or phone is not verified. -
valid_score_range
: the score is within inclusive bounds using chained comparison.
Lösning
Tack för dina kommentarer!
Awesome!
Completion rate improved to 5single