pencil-icon
Build your own quiz

Computers

10th -

12thgrade

Image

CodeHS Lessons 6-12

0
plays

19 questions

Show Answers
See Preview
  • 1. Multiple Choice
    30 seconds
    1 pt

    Why do we use if statements in Java?

    To break out of some block of code

    To do something only if a condition is true

    To do something while a condition is true

    To repeat something for a fixed number of times

  • 2. Multiple Choice
    30 seconds
    1 pt

    Which general if statement definition is written correctly?

    for(condition)

    {

    //code

    }

    if(condition)

    {

    //code

    }

    if(int i = 0; i < count; i++

    {

    //code

    }

    if(false)

    {

    //code

    }

  • 3. Multiple Choice
    30 seconds
    1 pt

    Why do we use if/else statements in Java?

    To repeat something for a fixed number of times

    To either do something if a condition is true or do something else

    To break out of some block of code

    To repeat something while a condition is true

  • Answer choices
    Tags
    Answer choices
    Tags

    Explore all questions with a free account

    Already have an account?