Pricefield | Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@[email protected] to Programmer [email protected] • 1 year ago

Exam Answer

programming.dev

message-square
128
fedilink
796

Exam Answer

programming.dev

@[email protected] to Programmer [email protected] • 1 year ago
message-square
128
fedilink
  • @[email protected]
    link
    fedilink
    22•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.

    • @[email protected]
      link
      fedilink
      64•1 year ago

      Yea, it’s pseudo code.

    • FlumPHP
      link
      fedilink
      25•1 year ago

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

      • @[email protected]
        link
        fedilink
        8•
        edit-2
        1 year ago
        function print(str) {
          console.log(str)
        }
        

        FTFY

      • @[email protected]
        link
        fedilink
        English
        12•1 year ago

        There technically is!

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

        Well. In browsers, anyways.

        • @[email protected]
          link
          fedilink
          4•1 year ago

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

      • @[email protected]
        link
        fedilink
        1•1 year ago

        deleted by creator

        • @[email protected]
          link
          fedilink
          English
          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.

    • @[email protected]
      link
      fedilink
      12•
      edit-2
      1 year ago

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

      run this

      • 56!
        link
        fedilink
        1•1 year ago

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

      • Ephera
        link
        fedilink
        6•1 year ago

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

        • @[email protected]
          link
          fedilink
          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)

    • @[email protected]
      link
      fedilink
      English
      1•1 year ago

      How do you know what language this is?

Programmer [email protected]

[email protected]
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
  • 127 users / day
  • 516 users / week
  • 1.12K users / month
  • 4.5K users / 6 months
  • 3 subscribers
  • 1.59K Posts
  • 56.8K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @[email protected]
  • Pierre-Yves Lapersonne
  • UI: 0.18.4
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org