Answers to Self-Review Exercises (Sections C.1–C.13)
-
sequence, selection, repetition.
if
…else
.sentinel, signal, flag or dummy.
strongly typed.
prefixed.
-
False. A set of statements contained within a pair of braces (
{
and}
) is called a block.False. A repetition statement specifies that an action is to be repeated while some condition remains true.
True.
True.
False. Instance variables of type
boolean
are given the valuefalse
by default.
-
z = x++ + y;
-
if ( count > 10 ) System.out.println( "Count is greater than 10" );
total -= --x;
-
q %= divisor; q = q % divisor;
-
-
int sum; int x;
x =
1;
sum =
0;
sum += x;
orsum = sum + x;
System.out.printf(
"The sum is: %d\n", sum );
-
C.5
product
=25
,x
=6
-
Error: The ...
Get Android How to Program, 3/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.