programming.dev
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
JPDev to Programmer Humor · 1 year ago

Exam Answer

message-square
129
link
fedilink
788

Exam Answer

JPDev to Programmer Humor · 1 year ago
message-square
129
link
fedilink
  • PhAzE@lemmy.ca
    link
    fedilink
    arrow-up
    67
    arrow-down
    4
    ·
    edit-2
    1 year ago

    The answer is 6. It’s 6 characters long.

    • potustheplant@feddit.nl
      link
      fedilink
      arrow-up
      22
      arrow-down
      25
      ·
      1 year ago

      Not really, no. That would be the answer if x= len(day). The code in the image would just throw an error.

      • PhAzE@lemmy.ca
        link
        fedilink
        arrow-up
        64
        ·
        1 year ago

        Yea, it’s pseudo code.

      • FlumPHP
        link
        fedilink
        arrow-up
        26
        ·
        1 year ago

        “Monday”.length is working JavaScript and does equal 6. No print command afaik though.

        • dvlsg@lemmy.world
          link
          fedilink
          English
          arrow-up
          12
          ·
          1 year ago

          There technically is!

          https://developer.mozilla.org/en-US/docs/Web/API/Window/print

          Well. In browsers, anyways.

          • Scrollone@feddit.it
            link
            fedilink
            arrow-up
            4
            ·
            1 year ago

            Yes, but it prints the page, so in this case it wouldn’t print anything

        • PrettyFlyForAFatGuy@feddit.uk
          link
          fedilink
          arrow-up
          8
          arrow-down
          1
          ·
          edit-2
          1 year ago
          function print(str) {
            console.log(str)
          }
          

          FTFY

        • AnAngryAlpaca@feddit.de
          link
          fedilink
          arrow-up
          1
          arrow-down
          3
          ·
          1 year ago

          deleted by creator

          • kia@lemmy.ca
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 year ago

            You don’t need terminating semicolons in JavaScript. They’re added in if missing. It can actually cause a few bugs around returns.

      • force@lemmy.world
        link
        fedilink
        arrow-up
        12
        arrow-down
        1
        ·
        edit-2
        1 year ago

        no it wouldn’t, because this is OCR reference language

        run this

        • Ephera@lemmy.ml
          link
          fedilink
          arrow-up
          6
          ·
          1 year ago

          What the heck, did someone invent a programming language, so students wouldn’t have to learn any real ones?

          • mounderfod@lemmy.sdf.org
            link
            fedilink
            arrow-up
            5
            ·
            1 year ago

            Having done OCR GCSE computing:
            It’s just a pseudocode style language that they use in exam questions so that you can understand the question regardless of which language your school had you study (in my case it was VB6 💀). In questions where you are asked to write code, you can use the reference language but realistically you just use the one you learned (although I did it all in python instead)

        • 56!@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          Huh interesting. In Scotland we had another one: https://en.wikipedia.org/wiki/Haggis_(programming_language)

      • fidodo@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        How do you know what language this is?

Programmer Humor

programmer_humor

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 2.29K users / day
  • 4.48K users / week
  • 8.2K users / month
  • 18.1K users / 6 months
  • 2.4K local subscribers
  • 23.3K subscribers
  • 1.39K Posts
  • 52.1K Comments
  • Modlog
  • mods:
  • adr1an
  • Feyter
  • BurningTurtle
  • Pierre-Yves Lapersonne
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org