times in Java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • js06am
    New Member
    • Feb 2007
    • 8

    #1

    times in Java

    Just working over some past-exam paper questions in preparation for my upcoming programing exam and I'm a little confused by the following:

    "Imagine that you have written a class o produce a four-digit clock display (showing times as a 24-hour clock, for example "14:30"). List four example of (legal) times that would be useful for testing that the display works correctly."

    Now this question is from a paper that is 2 years old so I apologise if it is out-dated, I'm just looking for clarification as marking-schemes for past-papers are not available.

    Thanks for your time.
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    I don't know whether or not I understand your question but I do like it; I would
    pick the following four times:
    Code:
    09:46
    18:23
    23:54
    07:15
    All digits are unique per time, the digits 0, 1, 2, 3, 4 and 5 appear twice, the
    digits 6, 7, 8 and 9 appear once and never, except for zero appear the digits
    twice in the same position. It's a bit like a magic square ;-)

    kind regards,

    Jos

    Comment

    Working...