• Card 18 / 76: Which conditional statement would be best suited for determining the flow of code based on an int that may have a value between 1 and 10? The program must react differently for each value.
    A) if-else statement
    B) if-else-if statement with multiple if-elses
    C) multiple if statements
    D) switch statement

    Answer:
    D) switch statement

  • Keyboard Shortcuts

    Previous Card ← Previous Card Button
    Next Card → Next Card Button
    Flip Card Space-Bar
<< First < Previous Next > Last >>

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now
Explanation:

D. A switch statement is best suited for situations where multiple possible conditions exist that must be accounted for.

A, B, and C are incorrect.

A is incorrect because the if-else statement only allows two conditions and this question calls for ten conditions.

B and C are incorrect because a combination of if statements should be used only when limited conditions are being checked.

Hide Choices Interactive Question Exam Home Page
https://www.jobilize.com/quiz-my-oca-mock-exam-by-mike-wolf

My OCA Mock

Author:

Access: Public Instant Grading

Flash Cards plugin by Curtis Blackwell github.com/curtisblackwell/flash_cards
Google Play and the Google Play logo are trademarks of Google Inc.
Ask
Rachel Carlisle
Start Quiz
Madison Christian
Start Quiz
Rachel Woolard
Start Quiz
Stephanie Redfern
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/quiz-my-oca-mock-exam-by-mike-wolf" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>