Something like Ruby has... (and this is simplified considerably)
Oh, that's right... Java doesn't DO ranges (gotta love it's C++ roots)
tempF = 60
result = case score
when 0..32: "Frozen"
when 33..40: "Way too cold for me"
when 41..55: "Too cold for me"
when 56..82: "Brrrr..."
when 83..110 "Now we're talking"
else "Time to move"
end
puts result
No comments:
Post a Comment