Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

9. Considering the following code segment: if ( num <0) { alert(It's a negative num.); } else { alert(It's a non-negative num.); } What will

9.

Considering the following code segment:

if ( num <0) {

alert("It's a negative num.");

}

else {

alert("It's a non-negative num.");

}

What will be displayed if num=0?

It's a positive num.

It's a non-negative num.

It's a zero.

Nothing will be displayed.

10.

Considering the following code segment:

if(x>y) {

y=x;

}

else if (x == y){

x=1000;

}

else{

y =100;

}

alert ( 'x=' + x + ', y = '+y);

Given x=0 and y=5, what will be displayed?

x=0, y=5

x=0, y=100

x=1000, y=100

x=0, y=0

11.

If variable answer stores a Boolean value, then what are the possible values for the variable?

0 or 1

"true" or "false"

true or false

any value

12.

Suppose variables roll1 = 3 and roll2 = 4, which of the following will be evaluated as true?

roll1>3 || roll2 > 3

roll1>3 && roll2 > 3

!(roll1==3)

roll1>3 || roll2 < 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

2. Employees and managers participate in development of the system.

Answered: 1 week ago