Module 5 Flashcards
Concept in which the statements of a program are executed in the order in which they occur
sequential flow of processing
Please select all of the clauses below which indicate an aspect of the if statement
A. Followed by an open round parenthesis
B. A conditional statement
C. Capable of assigning a value
D. Followed by one or more action clauses
E. Can alter the flow of the program execution
A. Followed by an open round parenthesis
B. A conditional statement
D. Followed by one or more action clauses
E. Can alter the flow of the program execution
Java statement that allows the programmer to make decisions on whether a section of code executes or not
if statement
What is the outcome of the following code?
do
{
System.out.println(“CS200”);
}
while (false);
A. CS200 is printed once
B. Nothing is printed
C. CS200 is printed continuously
D. CS200 is printed twice
A. CS200 is printed once
Which of the following keywords represent the three forms of iterative loops in Java?
A. while
B. do…while
C. each
D. for
E. begin
A. while
B. do…while
D. for
What are the two main components of an iterative loop in Java?
A. Its opening and closing round parenthesis
B. The evaluation of a Boolean expression yielding either true or false
C. A subordinate scope of program code
D. The evaluation of a Boolean expression yielding either true or false
C. A subordinate scope of program code
D. The evaluation of a Boolean expression yielding either true or false
Identity all of the conditional operators which occur in the list below
A. =
B. >=
C. !=
D. +
E. &&
B. >=
C. !=
Select the expression or expressions below which identify the purpose of a ! sign in a conditional clause
A. Specifies the negation of an elementary equals operator
B. Precedes an if statement
C. Reverses the logical sense of a conditional clause
D. Terminates an action statement
A. Specifies the negation of an elementary equals operator
C. Reverses the logical sense of a conditional clause
Which iterative procedure in Java always executes the subscope of code at least once?
A. while
B. do…while
C. do until
D. for
B. do…while
Which of the following is a valid header of the Java for statement?
A. for (double i = 1; i<=5; i++)
B. for (int i=1; i>=5; i- -)
C. for (int=1; i<=5; i++)
D. for (int i=5; i>0; i - -)
E. for (int i>1; i=5; i++)
C. for (int=1; i<=5; i++)
D. for (int i=5; i>0; i - -)
Compound conditional operators:
!
&&
||
No answer just study
What is the outcome of the following code?
int a = 5, b = 10, sum = 0;
if ((a++==5) || (b++==10))
{
sum = a + b;
}
System.out.println(a + “,” + b + “,” + sum);
A. 6,10,0
B. 6, 10, 16
C. 5, 10, 17
D. 5, 10, 0
B. 6, 10, 16
Which of the following are true regarding the do…while iterative loop in Java?
A. The do…while loop is the only iterative loop which requires two keywords to manage it
B. The conditional clause which governs the execution of a do…while loop is a standard conditional clause like any which occur in other conditional statements
C. It is possible for the do…while loop to not execute its code in the body of the loop if the condition starts off as false
D. The do…while loop is the only type of iterative loop in which a semicolon immediately follows the closing round parentheses which enclose its conditional clause
A. The do…while loop is the only iterative loop which requires two keywords to manage it
D. The do…while loop is the only type of iterative loop in which a semicolon immediately follows the closing round parentheses which enclose its conditional clause
In what sense are iterative procedures repetitious?
A. Iterative procedures are repetitious in that they contain programming standards
B. Iterative procedures are repetitious in that they include conditional clauses
C. Iterative procedures are repetitious in that they process the same subordinate scope of program code again and again until a condition is fulfilled
D. Iterative procedures are repetitious in that their subordinate scopes terminate with a closing curly bracket
C. Iterative procedures are repetitious in that they process the same subordinate scope of program code again and again until a condition is fulfilled
What happens if the break statement is left out of a case section in a switch statement in Java?
A. You will get a compiler error
B. Once the last statement in the case section is executed, control will flow out of the switch statement
C. You will get a runtime error
D. Once the last statement in the case section is executed, control will flow to the default case
E. Once the last statement in the case section is executed, control will flow into the next case section
E. Once the last statement in the case section is executed, control will flow into the next case section