Ternary Conditional Operators are OUTSIDE the #APCSA Java Subset. Students can write correct solutions using the Ternary Conditional Operator This operator can be used in any FRQ, but may be seen more ...
To determine whether x is even or odd, we can use the mod operator to determine whether x is divisible by 2. If the result of x % 2 is 0, then x is even otherwise, it is odd. To re-write this if ...