Complete the code to start a case statement for variable grade.
case [1] when 'A' puts 'Excellent' end
The case statement should check the variable grade to match its value with the when clauses.
Complete the code to print 'Good' when score is 80.
case score when [1] puts 'Good' end
score.The when clause should match the value 80 to print 'Good'.
Fix the error in the case statement to correctly print 'Pass' when result is 'pass'.
case result when [1] puts 'Pass' end
String values in Ruby must be quoted in when clauses to match correctly.
Fill both blanks to complete the case statement that prints 'Low' for scores less than 50 and 'High' for 50 or more.
case when score [1] 50 puts 'Low' when score [2] 50 puts 'High' end
The first when checks if score is less than 50, the second checks if it is 50 or more.
Fill all three blanks to create a case statement that prints the day type based on day: 'Weekend' for Saturday or Sunday, 'Weekday' for Monday to Friday, and 'Unknown' otherwise.
case day when [1], [2] puts 'Weekend' when 'Monday'..'Friday' puts '[3]' else puts 'Unknown' end
The when clause lists Saturday and Sunday as weekend days. The second when uses a range for weekdays and prints 'Weekday'.