Docsity

Fundamentals of Programming & Software Development - Switch and Case, Exams of Biology

Toggle sidebar
bg1
Fundamentals of
Programming &
Software
Development - Switch
and Case
Match each word to its correct meaning. - answer
break
keyword that provides escape from a code block so
that subsequent statements in the block will not
be processed
default
additional option included in the switch-case code
block that works like a catch-all for comparisons
that do not meet one of the case statement
choices
switch-case statement
an alternate method to if statements and nested if
statements that provides a cleaner, more easily
readable code block
pf3

Partial preview of the text

Download Fundamentals of Programming & Software Development - Switch and Case and more Exams Biology in PDF only on Docsity!

Fundamentals of

Programming &

Software

Development - Switch

and Case

Match each word to its correct meaning. - answer break keyword that provides escape from a code block so that subsequent statements in the block will not be processed default additional option included in the switch-case code block that works like a catch-all for comparisons that do not meet one of the case statement choices switch-case statement an alternate method to if statements and nested if statements that provides a cleaner, more easily readable code block

One practice of good programmers is to indent block code. - answer True Switch-case statements are based on fractions. - answer False Examine the following switch-case statement. If Answer = 10 % 3, what result would be output? Switch (Answer) { case 1: System.out.println ("The answer is 1"); break; case 2: System.out.println ("The answer is 2"); break; case 3: System.out.println ("The answer is 3"); break; default: System.out.println ("The answer is not here"); break; } - answer case 1 In a switch-case, why is a break required at the end of each case statement? - answer It tells the computer to advance to the next statement outside the switch block.