JavaScript Review 3

JavaScript Review 3

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

What statement would increase the value of a variable named nbr by one every time the statement was executed?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 14, 2020

Cards (7)

Section 1

(7 cards)

What statement would increase the value of a variable named nbr by one every time the statement was executed?

Front

nbr+=1

Back

Given the following declarations, write a nested if statement that alerts "Qualified" if the person's age is between the minimum age and the maximum age and "Nonqualified" otherwise. var maxAge-30; var minAge=21; var age=23;

Front

if (maxAge>=age) { if (minAge<=age) alert ('Qualified'); } else{ alert ('Nonqualified'); }

Back

What statement would increase the value of a variable named nbr by the value of a variable named amount every time the statement was executed?

Front

nbr=nbr+amount;

Back

Variables that are used on the right hand side of an assignment statement should always have...

Front

an initial value

Back

Given the following declarations, write a if statement without a nested if statement that alerts "Qualified" if the person's age is between the minimum age and the maximum age and "Nonqualified" otherwise. var maxAge-30; var minAge=21; var age=23;

Front

if (maxAge>=age)&&(minAge<=age){ alert('Qualified') } else{ alert('Nonqualified'); }

Back

Given the following declarations, write a if statement that alerts "Qualified" if the person's age is between the minimum age and the maximum age and "Nonqualified" otherwise. Also alert "Too Old" or "Too Young". var maxAge-30; var minAge=21; var age=23;

Front

if (maxAge,=age) { alert('Nonqualified, Too Old'); } if(minAge>=age){ alert('Nonqualified, Too Young'); } else{ alert('Qualified'); }

Back

Rewrite the two if statements in the dice program using 2 statements that are not if statements.

Front

document.getElementById('die1').src="http://balance3e.com/Images/die' +roll1+ '.gif; document.getElementById('die2').src="http://balance3e.com/Images/die' +roll2+ '.gif;

Back