• stoly@lemmy.world
    link
    fedilink
    arrow-up
    15
    arrow-down
    6
    ·
    3 months ago

    I wonder if day length is given separately in a table prior to the question? I’m not sure what they wanted except maybe seconds?

      • r00ty@kbin.life
        link
        fedilink
        arrow-up
        7
        arrow-down
        14
        ·
        3 months ago

        I’m not really a fan of this kind of question. Especially if there’s enough questions that time will be an issue for most. Because at first glance it’s easy to think the answer might be the length of a day.

        There shouldn’t be a need to try to trick people into the wrong answer on an open question. Maybe with multiple choice but not an open answer question.

        • CanadaPlus@lemmy.sdf.org
          link
          fedilink
          arrow-up
          19
          arrow-down
          2
          ·
          3 months ago

          It relies on critical thinking (meaning thinking about your own thinking), basically, and most students aren’t very good at that.

      • nathanjent@programming.dev
        link
        fedilink
        arrow-up
        5
        arrow-down
        2
        ·
        3 months ago

        What is the type of the variable day though? As it is we have to make multiple assumptions, based on popular programming languages, about the internals of the string type and the print function to assume that it prints “6”.

    • dog@suppo.fi
      link
      fedilink
      arrow-up
      4
      arrow-down
      8
      ·
      edit-2
      3 months ago

      Most date libraries count to 23h 59m 59s then roll over to 00h 00m 00s. So the answer is 23 hours, not 24.

      Edit: I’m big dum dum. It’s asking string length of “Monday”, thus 6.

      • deadbeef79000@lemmy.nz
        link
        fedilink
        arrow-up
        16
        ·
        3 months ago

        You’re also mistaken about the time too. The first second of the day is 00:00:00 the last second of the day is 23:59:59

        That’s still a full and exact 24 hours.

        • dog@suppo.fi
          link
          fedilink
          arrow-up
          7
          arrow-down
          1
          ·
          3 months ago

          Yes, it’s a full 24 hours, but a library doesn’t use 24:00:00 to represent the last hour, it’s 23:59:59. Once it hits 24:00, it rolls over to 00:00:00.

          Hence my initial error of answering 23.

          It’s not valid, but I don’t edit out erronous answers because I believe all data should be preserved, no matter how dumb it makes one look.

          • diverging@lemmy.ml
            link
            fedilink
            arrow-up
            3
            ·
            3 months ago

            00:00:00 is the 1st second of the day. 23:59:59 is the 86400th second of the day. That’s 24 hours.

          • deadbeef79000@lemmy.nz
            link
            fedilink
            arrow-up
            2
            ·
            3 months ago

            It’s not valid, but I don’t edit out erronous answers because I believe all data should be preserved, no matter how dumb it makes one look.

            Doing the lord’s work.

            I have but one up vote and you already have it.