You can maintain an array to represent the ranges you have given. I am talking about storing like.... say array name is array then array[0]=5 ie the max value of the first interval. then array[1]=10 max value of second interval and proceed in the same way. since this array you just maintained will only contain small number of value so no performance issue with linear search. Now if the numberOfOrderedItems are less than value_of_array you can break the loop and decide the discount you want to give.
If you are maintaining huge number of discount intervals then go for binary search instead of linear search.