Lesson 2

.docx

School

Ashworth College *

*We aren’t endorsed by this school

Course

K08V.1.1

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

6

Uploaded by PrivateIronPorcupine45

Report
Question 1 A programmer created a while loop in C#, but failed to provide an action in the while statement, which caused the condition of the while to return false. What will the result be? Question options: A compiler error An infinite loop Code execution stops after 100 loops based on the debugger settings True Question 2 Assuming a is a bool with a value of false, which of the following evaluates to true? Question options: !(!a) a !a !a! Question 3 Which of the following operators ensures that at least one out of multiple conditions is TRUE? Question options: || && == ^ Question 4 The | and & operators will __________ evaluate all operands in a conditional statement. Question options: never
always conditionally prematurely Question 5 In a loop, the programmer can terminate execution within the executing block of code by using the __________ statement. Question options: default continue break XOr Question 6 In a switch statement, the __________ case will execute code when no match occurs between the switch's expression label and the case label. Question options: default continue break XOr Question 7 In a loop, the programmer can continue execution within the executing block of code, but skip all remaining lines and simply return to the loop continuation test by using the __________ statement. Question options: default continue break XOr
Question 8 Which case of the following would warrant using the boolean logical inclusive OR (|) rather than the conditional OR (||)? Question options: Testing if two conditions are both true Testing if at least one of two conditions is true Testing if at least one of two conditions is true when the right operand has a required side effect Testing if at least one of two conditions is true when the left operand has a required side effect Question 9 The __________ loop always performs the logic condition test before attempting to execute the loop's body. Question options: for case do while switch Question 10 In a switch statement, the programmer can terminate execution within the executing case by using the __________ statement. Question options: default continue break XOr Question 11
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help