Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

# Thread: Help with a few multiple choice question..

1. ## 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

• Try sleeping with the teacher....

• ## Users who have thanked mrhoo for this post:

Philip M (09-04-2008)

• I wish I could but the lecturer is a man..and i aint that way inclined

No ideas anyone?

• Originally Posted by johngrit
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.

• 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.

• Originally Posted by johngrit
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?

• Hi johngrit,

• 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

• And just to add, there are 100 questions..

These are the ones I just wanted clarification on

• Originally Posted by johngrit
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.

• 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

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

• 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
•