Thread: Bitwise Test Questions

  1. #1
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511

    Wink Bitwise Test Questions

    Allright, I have a final exam in my C class in 2 weeks. The final exam is over binary files, single linked lists, and bitwise ops. I found these three questions out the answer manual in our c book. However, I have a problem with the "wording" and the answers on these questions.

    I want to know what you think about these three questions- tell me if you agree or disagree with these problems:

    25. Which statement is true of the << operator?
    a) It is called the right shift operator.
    b) It is called the bitwise right shift operator.
    c) It shifts the bits of the second operand left by the number of bits specified by the first operand.
    d) It fills from the right with 0 bits.

    Ans: d) It fills from the right with 0 bits.
    29. Which statement is true?
    a) || is the bitwise or operator,
    b) | is the logical or operator
    c) Operators || are interchangeable.
    d) || and | are each binary operators.

    Ans: d) || and | are each binary operators.

    17. Which of the following is not true?
    a) Lists of data can be stored in arrays.
    b) The length of a linked list can vary dynamically.
    c) Arrays can become full.
    d) Linked lists cannot become full.
    Ans: d) Linked lists cannot become full.
    Thanks
    Mr. C: Author and Instructor

  2. #2
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    25. Which statement is true of the << operator?
    a) It is called the right shift operator.
    b) It is called the bitwise right shift operator.
    c) It shifts the bits of the second operand left by the number of bits specified by the first operand.
    d) It fills from the right with 0 bits.

    Ans: d) It fills from the right with 0 bits.


    --------------------------------------------------------------------------------
    The wording may be a bit balky, but a, b, and c are definately not true.



    quote:
    --------------------------------------------------------------------------------

    29. Which statement is true?
    a) || is the bitwise or operator,
    b) | is the logical or operator
    c) Operators || are interchangeable.
    d) || and | are each binary operators.

    Ans: d) || and | are each binary operators.

    --------------------------------------------------------------------------------
    c is not a complete sentence, and d is right.




    quote:
    --------------------------------------------------------------------------------

    17. Which of the following is not true?
    a) Lists of data can be stored in arrays.
    b) The length of a linked list can vary dynamically.
    c) Arrays can become full.
    d) Linked lists cannot become full.
    Ans: d) Linked lists cannot become full.

    --------------------------------------------------------------------------------
    What's your question? D is right, the others are wrong. If you're wondering how, one way is to run out of memory (malloc () returns NULL and voila, your linked list is full)
    hello, internet!

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >Ans: d) It fills from the right with 0 bits.
    Awful wording.

    >Ans: d) || and | are each binary operators.
    I have little doubt that your students will be confused the the apparently contradictory use of the words bitwise and binary.

    >17. Which of the following is not true?
    >Ans: d) Linked lists cannot become full.
    Obviously meant to trick the reader with the wording. One can figure it out, but I frown on questions like this.

    -Prelude
    My best code is written with the delete key.

  4. #4
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511
    Moi, Prelude- Thanks I had problems with the wording on these questions as well.
    Mr. C: Author and Instructor

  5. #5
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Those trick questions are nothing more than pig fodder.

    You should be ashamed of yourself. What kind of garbage are you teaching anyway? Those questions are neither worthy nor relevant. If your teaching is thorough, there is no need to verify your students understanding of such trivial ideas as these. How about thinking up something from your own mind that reflects the true spirit of programming?

    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  6. #6
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    Originally posted by Prelude

    >17. Which of the following is not true?
    >Ans: d) Linked lists cannot become full.
    Obviously meant to trick the reader with the wording. One can figure it out, but I frown on questions like this.

    -Prelude
    lol, i'm in high school right now, taking AP tests, SATs, and other standardized mayhems; such crap has become second nature to me
    hello, internet!

  7. #7
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Re: Bitwise Test Questions

    Originally posted by Mister C
    17. Which of the following is not true?
    a) Lists of data can be stored in arrays.
    b) The length of a linked list can vary dynamically.
    c) Arrays can become full.
    d) Linked lists cannot become full.
    Ans: d) Linked lists cannot become full.
    In theory, linked lists can have limitless size, but in practise, they are limited by the systems resources (of course).
    I really don't like the double negated question, since it confuses the reader. This should be a test of C/C++, not in reading a question correctly.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  8. #8
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511

    Red face

    OK then since you do not like these questions- I did not make these up. What kind of C final exam should I give my class then.



    lol, i'm in high school right now, taking AP tests, SATs, and other standardized mayhems; such crap has become second nature to me

    Well, I agree reading the questions on most standardized tests is the hardest part.

    Let me know about the test.
    Mr. C: Author and Instructor

  9. #9
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >What kind of C final exam should I give my class then.
    Write a program that matches their level of understanding and require them to describe how it works and why. Perhaps you can write several incorrect programs and have your students debug them as well as explain what was going wrong and why.

    -Prelude
    My best code is written with the delete key.

  10. #10
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511
    >What kind of C final exam should I give my class then.
    Write a program that matches their level of understanding and require them to describe how it works and why. Perhaps you can write several incorrect programs and have your students debug them as well as explain what was going wrong and why.
    Yes, on a test I give them a Multiple Choice, True/False, Debugging- were the have to correct code, and 2-3 programming problems to write.
    Mr. C: Author and Instructor

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. My C++ test is COMING!!...
    By [Z-D] in forum C++ Programming
    Replies: 52
    Last Post: 12-01-2006, 08:02 PM
  2. undefined reference
    By 3saul in forum Linux Programming
    Replies: 12
    Last Post: 08-23-2006, 05:28 PM
  3. Replies: 4
    Last Post: 03-21-2006, 10:21 PM
  4. Taking a Programming Test and need help with something.
    By 1BadRbt in forum C++ Programming
    Replies: 2
    Last Post: 03-21-2006, 06:19 AM
  5. Replies: 5
    Last Post: 10-30-2002, 10:23 PM