This week's book giveaway is in the Performance forum.We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!

# need help in my exam question.

xiao sean
Ranch Hand
Posts: 44
hi guys,

i just took my paper and i have serious doubt with my answer in this question.

can anyone work out the answer?

well from what i have work out, my answer is 6. any other answer?

Test Set 1: (0 <= exceededSpeed <= 10, isRepeat = true) to test if we get 0
Test Set 2: (0 <= exceededSpeed <= 10, isRepeat = false) to test if we get 0
Test Set 3: (11 <= exceededSpeed <= 20, isRepeat = true) to test if we get 40
Test Set 4: (11 <= exceededSpeed <= 20, isRepeat = false) to test if we get 20
Test Set 5: (exceededSpeed > 20, isRepeat = true) to test if we get 100
Test Set 6: (exceededSpeed > 20, isRepeat = false) to test if we get 50

in another way.

Test Set 1: (0 <= exceededSpeed <= 10, isRepeat = true) to test if we get a
Test Set 2: (0 <= exceededSpeed <= 10, isRepeat = false) to test if we get b
Test Set 3: (11 <= exceededSpeed <= 20, isRepeat = true) to test if we get c
Test Set 4: (11 <= exceededSpeed <= 20, isRepeat = false) to test if we get d
Test Set 5: (exceededSpeed > 20, isRepeat = true) to test if we get e
Test Set 6: (exceededSpeed > 20, isRepeat = false) to test if we get f
[ May 22, 2008: Message edited by: xiao sean ]

Campbell Ritchie
Sheriff
Posts: 49405
62
I would have put in a matrix eg,
• speed 0, 49, 59, 69, 79, 89, 99, 9834756983475, -83745834, 31, 41, 51, 61, 71, 81, 91
• first offence and repeat offence
• speed limit 0, 30, 40, 50, 60, 100, 394593487, -8374534
• The reason for the strange numbers is to see what happens if you enter a ridiculous input.

xiao sean
Ranch Hand
Posts: 44
sorry, but i seem can't catch what you trying to say..

Campbell Ritchie
Sheriff
Posts: 49405
62
Speed limit 0, first offence, speed 0, 9, 11, 21, 31, 41, 51, 61, -9999999
Speed limit 0, not first offence, speed 0, 9, 11, 21, 31, 41, 51, 61, -9999999
Speed limit 10, first offence, speed 0, 9, 11, 21, 31, 41, 51, 61, -9999999
Speed limit 10, not first offence, speed 0, 9, 11, 21, 31, 41, 51, 61, -9999999
Speed limit 50, first offence, speed 0, 9, 11, 21, 31, 41, 51, 61, -9999999
Speed limit 50, not first offence, speed 0, 9, 11, 21, 31, 41, 51, 61, -9999999
Speed limit 1000000, first offence, speed 0, 9, 11, 21, 31, 41, 51, 61, -9999999
Speed limit 1000000, not first offence, speed 0, 9, 11, 21, 31, 41, 51, 61, -9999999

etc