From f5cab1c16a9a7074207ecba4666c444d7eac852d Mon Sep 17 00:00:00 2001 From: Oumaima Fisaoui <48260689+Oumaimafisaoui@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:47:31 +0100 Subject: [PATCH] Chore(AI-GO): Fixed instructions in only if --- subjects/AI.GO/only-if/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/subjects/AI.GO/only-if/README.md b/subjects/AI.GO/only-if/README.md index 732f13f28..625c7893e 100644 --- a/subjects/AI.GO/only-if/README.md +++ b/subjects/AI.GO/only-if/README.md @@ -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!