Exam 5: Loops and Files

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Assuming outFile is a file stream object and number is a variable, which statement writes the contents of number to the file associated with outFile?

Free
(Multiple Choice)
4.9/5
(34)
Correct Answer:
Verified

C

How many times will the following loop display "Hello"? How many times will the following loop display Hello?

Free
(Multiple Choice)
4.8/5
(42)
Correct Answer:
Verified

B

A loop that is inside another loop is called:

Free
(Multiple Choice)
4.9/5
(40)
Correct Answer:
Verified

D

This may be used to write information to a file.

(Multiple Choice)
4.9/5
(37)

What will the following code display? What will the following code display?

(Multiple Choice)
4.8/5
(38)

Multiple relational expressions cannot be placed into the test condition of a for loop.

(True/False)
4.7/5
(40)

How many times will the following loop display "Hello"? How many times will the following loop display Hello?

(Multiple Choice)
4.9/5
(42)

Look at the following statement. while Look at the following statement. while   Which operator is used first? Which operator is used first?

(Multiple Choice)
4.7/5
(39)

What will the following code display? What will the following code display?

(Multiple Choice)
5.0/5
(34)

A file must be ________ before data can be written to or read from it.

(Multiple Choice)
4.8/5
(31)

This loop is a good choice when you know how many times you want the loop to iterate in advance of entering the loop.

(Multiple Choice)
4.9/5
(32)

A file ________ is a small holding section of memory that file-bound information is first written to.

(Multiple Choice)
4.9/5
(38)

An output file is a file that data is written to.

(True/False)
4.9/5
(45)

You may not use the break and continue statements within the same set of nested loops.

(True/False)
4.8/5
(40)

You may define a ________ in the initialization expression of a for loop.

(Multiple Choice)
4.8/5
(25)

The increment and decrement operators can be used in mathematical expressions; however, they cannot be used in relational expressions.

(True/False)
4.8/5
(34)

If you want to stop a loop before it goes through all its iterations, the break statement may be used.

(True/False)
4.8/5
(40)

A for statement contains three expressions: initialization, test, and

(Multiple Choice)
4.8/5
(40)

What is the output of the following code segment? What is the output of the following code segment?

(Multiple Choice)
4.9/5
(30)

This operator increments the value of its operand, then uses the value in context.

(Multiple Choice)
4.8/5
(30)
Showing 1 - 20 of 63
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)