JAVA - CH.3

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Which set represents compound assignment operators? a. ++, -- b. %d, %s, =!, !=, /= c. **, *=, ==, /=, %= d. +=, -=, *=, /=, %= e. =/, =+, ==, =, %%

D

(T/F) The primitive types (boolean, char, byte, short, int, long, float and double) are portable across only Windows platforms

False

Instance variable of type boolean are given the value ________ by default.

False

(T/F) A selection statement repeats an action while a condition remains true

False (an iteration statement does this)

(T/F) A set of statements contained within a pair of parentheses is called a block

False (block = contained within braces)

To block or scope multiple lines of code in a control structure, you must use ___________.

braces

Repeating a set of instructions a specific number of times is called __________ repetition.

counter-controlled

The if...else statement is a....

double-selection statement, performs action if condition true, performs a different action if condition false

The unary case operator (double) creates a temporary __________ copy of its operand

floating-point

The __________ statement is used to execute one action when a condition is true and another when that condition is false

if...else

while and do...while are examples of _______ statements.

iteration

The switch statement is a ...

multiple-selection statement, performs one of many different actions depending on value of expression

The unary operator ++ is a(n) _________ operator when used after the numeric variable.

postincrement

The unary operator -- when used before a numeric variable is a(n) __________ operator.

predecrement

If the increment operator is _______ to a variable, first the variable is incremented by 1, then its new value is used in the expression.

prefixed

When the declaration int y = 5; is followed by the assignment y += 3.3; the value of y is _________.

8 (no cast used, so .3 part is dropped)

(T/F) A nested control statement appears in the body of another control statement

True

(T/F) An algorithm is a procedure for solving a problem in terms of the actions to execute and the order in which they execute

True

(T/F) Java provides the arithmetic compound assignment operators +=, -=, *=, /=, and %= for abbreviating assignment expressions

True

(T/F) Pseudocode helps you think out a program before attempting to write it in a programming language

True

(T/F) Repetition or looping enables a program to perform statements repeatedly as long as a condition called the loop-continuation condition remains true.

True

(T/F) Specifying the order in which statements execute in a program is called program control

True

When it's not known in advance how many times a set of statements will be repeated, a(n) _________ value can be used to terminate the iteration

sentinel (signal, flag, or dummy)

Which control structure executes code one after the other in the order they're written (or in the order they appear)?

sequence

The _________ is built into Java; by default, statements execute in the order they appear.

sequence structure

All programs can be written in terms of three types of control structures: ________, _________, and _________.

sequence, selection, iteration

The if statement is a...

single-selection statement, selects action if condition true, skips action if condition false


Set pelajaran terkait

Unit 5 deviance ( part four), Deviance Practice Questions, Deviant Behavior Quiz 4 Ch15-, Deviance part 2, Social Deviance Part 3 and 4, Sociology Final Crime and Deviance Vocab Part 4

View Set

False or False: The Question of Falsifiability

View Set

World History Since 1500 Test #3

View Set

Robin Hood - Grade 7 - Characters

View Set

Week 2: Surgery and Nutrition support

View Set