Code Ramp
Quiz by , created more than 1 year ago

Quiz on Conditionals, created by Code Ramp on 12/04/2018.

475
0
0
Code Ramp
Created by Code Ramp about 6 years ago
Close

Conditionals

Question 1 of 5

1

Fill the blank space to complete the text.

A expression can evaluate to one of two values: a true or a false.

Explanation

Question 2 of 5

1

Which of the following are examples of comparison operators?

Select one or more of the following:

  • >=

  • ===

  • >>

  • <

Explanation

Question 3 of 5

1

Which of the following is the logical operator meaning `OR`?

Select one of the following:

  • !==

  • ||

  • <>

  • !

Explanation

Question 4 of 5

1

If you want to include a catchall block of code that would run anytime your `if` condition did not pass, you would use an `else if` block.

Select one of the following:

  • True
  • False

Explanation

Question 5 of 5

1

What are some style best practices when it comes to if/else statements?

Select one or more of the following:

  • Wrapping your condition in parentheses

  • Indenting the body of your if/else statement (the stuff between the {})

  • Ending your if/else statement with a semicolon

  • Putting your whole if/else statement on one line

Explanation