# Your function should return:
# 1. The string "1 - 50" if the number is between 1 to 50
# 2. The string "51 - 100" if the number is between 51 to 100
# 3. The string "101 - 200" if the number is between 101 to 200
# 4. The string "greater than 201" if the number is greater than 201
def get_range(number)
#your code here
if number >= 1 and number <= 50
"1 - 50"
elsif number >= 51 and number <=100
"51 - 100"
elsif number >= 101 and number <=200
"101 - 200"
elsif number >= 201
"greater than 201"
else
"zero or negative numbers aren't allowed"
end
end
get_range(70)
No comments:
Post a Comment