Compare how the if statement and the switch statement are alike (site 3 ways). Explain how they’re not alike (site 2 ways).

What will be an ideal response?


The if and switch statements can be used to check integer or character values. The if/else if / else statements correspond to the switch’s case/default statements. The if and switch don’t require that there is an else/default block of code. The if statement can use complicated logic in the conditional statements, switch statements typically do not. The if statement can be used to do string comparisons in their conditional statements, switch statements cannot.

Computer Science & Information Technology

You might also like to view...

When a SmartArt graphic's height or width is changed the width is resized proportionally

Indicate whether the statement is true or false

Computer Science & Information Technology

The two background elements of an Excel chart are:

A) plot area and chart area. B) fill and line. C) legend and axis. D) error bars and gridlines.

Computer Science & Information Technology

 A(n) ____________________ specifies each of the use case sequences by describing what the user will do and how the program will respond.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

To search an array for a(n) ____ match, you can store either the highest or lowest value of each range for comparison.

a. Subscript b. Range c. Flag d. Index

Computer Science & Information Technology