Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: I have an assignment  (Read 10722 times)

0 Members and 1 Guest are viewing this topic.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: I have an assignment
« Reply #15 on: September 13, 2010, 09:01:12 PM »
"how did you do" will be printed, since nothing in the if/else match 100.



I appear to have missed that.

It might be a kind of "educational pseudocode".


my first thought was C++, but with macros that change things- macros for and to be &&, endif = }, cin >> = input, cout << = input, etc. Sadly, you see that type of thing all the time, and it doesn't make a whole lot of sense. If you want to teach a language that uses, for example, endif, then use such a language, don't just hodgepodge a bunch of C++ macros to do it that way.

Oh well.

The only problem is that there is no starting brace for the if blocks if that was the case.

I'd definitely have to say it's some sort of psuedocode as well.


A Google search showed that very same assignment was posted on justanswer.com's "Ask a Homework Question, Get an Answer ASAP!" service, "790 days and 19 hours ago.". (You have to pay to see the answer - 3 UK pounds)

I would have suspected as much. It's not like it's particularly difficult- it involves more math concepts then it does programming concepts. Although it's a lot better then the trivia-related questions both in classes as well as as interview question. Stupid, retarded questions that essentially test ones knowledge of a few language corner cases, like "Is it possible for a function to return more often than it is called?" or how does the XXX keyword work, or other nonsense. It's pointless to ask such questions- you're trying to make/find programmers, not people who read and memorize language references. You want to find somebody who won't sit around testing out a certain programming construct or modifier to see what it does and will instead actually defer to the language reference to find out; a question like:

Quote
what is the output from
2["hello"]
and why?
Is a completely stupid question. First off, is it really that important that they know how to deal with such trivial corner cases? Sure, it proves they have a handle on pointers, but it also proves that they are willing to make "clever" code when it's not necessary, and their code is probably strewn with ternary conditionals. "clever" code is bad and difficult to read. Clever interview questions are bad because they encourage clever code.

I was trying to dereference Null Pointers before it was cool.

Salmon Trout

  • Guest
Re: I have an assignment
« Reply #16 on: September 13, 2010, 11:43:13 PM »
Do you think Big is Billrich? And MichelleCarrothers?

CBMatt

  • Mod & Malware Specialist


  • Prodigy

  • Sad and lonely...and loving every minute of it.
  • Thanked: 167
    • Yes
  • Experience: Experienced
  • OS: Windows 7
Re: I have an assignment
« Reply #17 on: September 15, 2010, 06:23:58 AM »
I don't think Big should have posted what he did, but then he seems to do what he likes, even after being told what forum policy is.

Don't like the competition, eh?
Quote
An undefined problem has an infinite number of solutions.
—Robert A. Humphrey

Big



    Beginner

    Thanked: 4
    • Experience: Experienced
    • OS: Windows XP
    Re: I have an assignment
    « Reply #18 on: September 15, 2010, 06:31:22 AM »
    Quote
    -1 wouldn't be an operand, since the - is a unary minus operator
    I guess One's Complement doesn't count here (signed bit)? :P
    Computerhope is corrupt.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: I have an assignment
    « Reply #19 on: September 15, 2010, 07:39:16 AM »
    I guess One's Complement doesn't count here (signed bit)? :P

    No, because even if that was the case, it would be in the form of an operator (such as C's ~) :P

    Although I imagine there are languages out there that may actually not represent negative numbers via unary operators. Don't know any off the top of my head though.
    I was trying to dereference Null Pointers before it was cool.

    Salmon Trout

    • Guest
    Re: I have an assignment
    « Reply #20 on: September 15, 2010, 10:17:37 AM »
    Don't like the competition, eh?

    I resent that. What a stupid remark. Idiotic even. I don't do people's homework for them.

    Allan

    • Moderator

    • Mastermind
    • Thanked: 1260
    • Experience: Guru
    • OS: Windows 10
    Re: I have an assignment
    « Reply #21 on: September 15, 2010, 11:53:05 AM »
    Locked