List the four keywords used in a switch structure and provide a brief description of each.

What will be an ideal response?


The switch structure uses four keywords:
* The keyword switch starts the structure and is followed immediately by a test expression (called the switch expression) enclosed in parentheses.
* The keyword case is followed by one of the possible values that might equal the switch expression. A colon follows the value. The entire expression-for example, case 1:-is a case label. A case label identifies a course of action in a switch structure. Most switch structures contain several case labels.
* The keyword break usually terminates a switch structure at the end of each case. Although other statements can end a case, break is the most commonly used.
* The keyword default optionally is used prior to any action that should occur if the test expression does not match any case.

Computer Science & Information Technology

You might also like to view...

Which is not one of the four basic symbols used to chart data movement on data flow diagrams?

A) an oval B) arrow C) rectangle with rounded corners D) open-ended rectangle

Computer Science & Information Technology

Layered strokes can be created from ____.

A. a combination of dashed and non-dashed strokes B. only dashed strokes C. only dotted strokes D. only non-dashed strokes

Computer Science & Information Technology

In SharePoint, an announcement ________ initially contains a title, body, and optional expiration date, but attachments can also be added

Fill in the blank(s) with correct word

Computer Science & Information Technology

Microdata enables you to add semantic information to specific web page elements.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology