R_Code-14.r (487B)
1 # Write an if...else if...else block that evaluates a newly created temperature variable. 2 # * If the temperature is strictly greater than 30, print: "30+ is too hot!" 3 # * If the temperature is between 20 and 30 (inclusive), print: "Perfect weather." 4 # * Otherwise, print: "It is quite cold." 5 6 temperature <- 29 7 if(temperature > 30) { 8 print("30+ is too hot!") 9 } else if(temperature >= 20 && temperature <= 30) { 10 print("Perfect weather") 11 } else { 12 print("It is quite cold.") 13 }