Complete the code to assign the maximum of two numbers to max.
val max = if (a > b) [1] else b
b in the if part instead of a.The if-else expression returns a if a is greater than b, otherwise b.
Complete the code to assign a message based on the score.
val message = if (score >= 50) [1] else "Try again"
If the score is 50 or more, the message should be "Passed", otherwise "Try again".
Fix the error in the if-else expression to assign the correct value.
val result = if (num % 2 == 0) [1] else "Odd"
Even without quotes causing a compile error.The if-else expression must return a string in both cases. "Even" is the correct string for even numbers.
Fill both blanks to assign a grade based on the score.
val grade = if (score >= [1]) "A" else if (score >= [2]) "B" else "C"
A and B.The highest grade A is for scores 90 and above, grade B for 80 and above, else C.
Fill all three blanks to assign a description based on temperature.
val description = if (temp < [1]) "Cold" else if (temp < [2]) "Warm" else [3]
Temperatures below 10 are "Cold", below 25 are "Warm", and 25 or above are "Hot".
