If userTickets > 6, execute awardPoints = 10. Else, execute awardPoints = userTickets.

Check the final answer first, then review the worked steps.

Answer

\(if (userTickets > 6) { awardPoints = 10; } else { awardPoints = userTickets; }\)

Approach

if (userTickets > 6) awardPoints = 10; else awardPoints = userTickets;

Step-by-step solution

  1. Use an if-else statement to check the condition.
  2. Check if userTickets is greater than 6.
  3. If true, set awardPoints to 10.
  4. Otherwise, set awardPoints to userTickets.