Complete the code to assign 'adult' if age is 18 or more, otherwise 'minor'.
status = age [1] 18 ? 'adult' : 'minor'
The ternary operator checks if age >= 18. If true, it assigns 'adult', else 'minor'.
Complete the code to assign 'even' if number is divisible by 2, else 'odd'.
result = number.[1](2) == 0 ? 'even' : 'odd'
In Ruby, number.remainder(2) returns the remainder after division by 2. If it's 0, the number is even.
Fix the error in the ternary operator to assign 'positive' if num > 0, else 'non-positive'.
label = num [1] 0 ? 'positive' : 'non-positive'
The correct comparison operator is > to check if num is greater than zero.
Fill both blanks to assign 'high' if score is above 80, else 'low'.
level = score [1] 80 ? 'high' : '[2]'
The condition checks if score > 80. If true, assign 'high', else 'low'.
Fill all three blanks to create a ternary that assigns the uppercase name if active is true, else lowercase.
display_name = active ? name.[1] : name.[2].[3]
If active is true, name.upcase is used. Otherwise, name.downcase.strip is used to clean whitespace.