Skip to content

Commit

Permalink
Chore(AI-GO): Fixed instructions in only if
Browse files Browse the repository at this point in the history
  • Loading branch information
Oumaimafisaoui committed Oct 2, 2024
1 parent 3b79b28 commit f5cab1c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions subjects/AI.GO/only-if/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,19 @@ Your Robot must always seek the truth.

#### Task 2:

Your `RoboGuard's traveling company` has a special promotion for robot members aged between 18 (included) and 25 (included). Write the if condition that will check if the robot user can benefit from the promotion:
Your `RoboGuard's traveling company` has a special promotion for robot members aged between 18 (included) and 25 (included).

- `user.age` must be more than `17`.
**NB: The ticket variable has already been declared, so do not declare it again.**

1- Assign the message "You cannot benefit from our special promotion" to the ticket variable.

2- Use an if statement to check that all these conditions are true:

- `user.age` must be greater than or equal to `18`.
- `user.age` must be less than or equal to `25`.
- `user.activeMembership` must be `true`.

If `all` of these conditions are `true`, log the message '`You can benefit from our special promotion`'.
3- If all conditions are true, update the ticket variable with the message: "You can benefit from our special promotion".

> Hint : use AND Operator in your condition!
Expand Down

0 comments on commit f5cab1c

Please sign in to comment.