Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help with a few multiple choice question..

    Doing a multiple choice paper, just need clarification on a few questions...
    Any help would be much appreciated...I am a bit of a novice on this

    1.

    Consider this informal description of some instructions:

    if (__________________)

    document.write(aNumber is between 1 and 10 inclusive)
    else
    document.write(aNumber is less than 1 or greater than 10)

    Which of the following Boolean conditions could be used to test correctly
    the value of aNumber? You can assume that aNumber has been properly
    declared and holds an integer value. (Select one option.)

    A. (aNumber >= 1) || (aNumber <= 10)
    B. (aNumber < 1) || (aNumber > 10)
    C. (aNumber >= 1) && (aNumber <= 10)
    D. (aNumber > 1) && (aNumber < 10)

    2.

    Consider the following compound condition:

    Y AND (X AND Y)

    Which of the following is equivalent to it? (Select one option.)

    A. X OR Y
    B. X
    C. Y AND X
    D Y

    3.

    Consider the following JavaScript program

    var number;
    number = window.prompt('please enter a number between 1 and 10', '0');
    number = parseFloat (number);
    if ((number == 1) || (number == 3) || (number == 5))
    {
    document.write('You have won 2 pounds')
    }
    else if ((number == 2) || (number != 6))
    {
    document.write('You have won 4 pounds')
    }
    else
    {
    document.write('You have won 8 pounds')
    }

    What will be displayed if you enter 6 in response to the prompt when the program is run? (Select one option.)

    A. You have won 2 pounds
    B. You have won 4 pounds
    C. You have won 6 pounds
    D. You have won 8 pounds

    4.

    Consider the following fragment of JavaScript

    var a = 7;
    var b = 4;
    var c = a - b;
    number = 2 * (16 - b) / 6 + (a * (9 + c) + (c - a));
    document.write (number);

    What will be displayed when the program is run? (Select one option.)

    A. 12
    B. 109
    C. 44
    D. 84
    E. Undefined

    5.

    In which of the following places would you expect to find the definition of a JavaScript event handler function to respond to a button click event?
    (Select one option.)

    A. After the ONCLICK keyword in the button declaration.
    B. In a SCRIPT section in the HEAD of the HTML page where the button is declared.
    C. In a SCRIPT section in the BODY of the HTML page where the button is declared.
    D. In the FORM declaration which contains the button declaration.

    6.

    Consider this fragment of JavaScript:

    var numArray = [9 , 8 , 7 , 6 , 5];
    writeArray ();

    function writeArray ()
    {
    var numArray = [1 , 2 , 3 , 4 , 5 , 6];
    for (var count = 1; count < 6; count = count + 1)
    document.write(numArray[count] + ' ');
    }

    What will be displayed when the program is run? (Select one option.)

    A. 1 2 3 4 5 6
    B. 9 8 7 6 5
    C. 2 3 4 5 6
    D. 9 8 7 6 5 Undefined

  • #2
    Regular Coder
    Join Date
    Mar 2006
    Posts
    728
    Thanks
    35
    Thanked 132 Times in 123 Posts
    Try sleeping with the teacher....

  • Users who have thanked mrhoo for this post:

    Philip M (09-04-2008)

  • #3
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I wish I could but the lecturer is a man..and i aint that way inclined

    No ideas anyone?

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,142
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    Quote Originally Posted by johngrit View Post
    I wish I could but the lecturer is a man..and i aint that way inclined

    No ideas anyone?
    Sorry, no-one on this forum is going to help you cheat. And it is not in your interests to do so. You cannot go through life cheating your way through your exams, you know. If you cannot answer these rather simple questions it suggests that you have made little or no effort with the course you are following. That in turn suggests that you may be better off dropping JavaScript and taking up underwater motorcycling instead.

  • #5
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry was that supposed to be funny....

    If you read my original post correctly..

    ''Doing a multiple choice paper, just need clarification on a few questions......I am a bit of a novice on this''

    then you may understand why i am posting this.

    I dont appreciate being accused of cheating.

  • #6
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,142
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    Quote Originally Posted by johngrit View Post
    Sorry was that supposed to be funny....

    If you read my original post correctly..

    ''Doing a multiple choice paper, just need clarification on a few questions......I am a bit of a novice on this''

    then you may understand why i am posting this.

    I dont appreciate being accused of cheating.
    Well, what word would you use for getting someone else to answer your question paper for you?

  • #7
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Hi johngrit,
    Please follow #1.5 under http://www.codingforums.com/rules.htm
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #8
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How many times I am not getting someone else to answer my paper as you put it..

    I have the questions done, just want to make sure I have them right..

    If thats wrong then ok

  • #9
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    And just to add, there are 100 questions..

    These are the ones I just wanted clarification on

  • #10
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,142
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    Quote Originally Posted by johngrit View Post
    How many times I am not getting someone else to answer my paper as you put it..

    I have the questions done, just want to make sure I have them right..
    I believe you, but others may not.

  • #11
    Regular Coder
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    159
    Thanks
    2
    Thanked 15 Times in 15 Posts
    John, maybe you can tell us which answers you gave, and we can tell you whether or not you got them right and possibly help you with the one's you may not have got right?


    Just a suggestion

    ~Jordan
    Remember The Thank You Button Is Your Friend =]

    [ PHP / Javascript / VisualBasic / HTML / DHTML / CSS / .NET / MySQL ]

  • #12
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My answers are -

    1. b
    2. d
    3. b
    4. c
    5. c
    6. c

    Remember I am a noivice at the beginning of a course..In case any of the are wrong that is

  • #13
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Am i right?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •