File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes need help in my exam question. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "need help in my exam question." Watch "need help in my exam question." New topic
Author

need help in my exam question.

xiao sean
Ranch Hand

Joined: Aug 20, 2007
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

Joined: Oct 13, 2005
Posts: 40052
    
  28
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

    Joined: Aug 20, 2007
    Posts: 44
    sorry, but i seem can't catch what you trying to say..
    Campbell Ritchie
    Sheriff

    Joined: Oct 13, 2005
    Posts: 40052
        
      28
    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
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: need help in my exam question.