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
(80)
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
(78)
Correct Answer:
Verified

B

A loop that is inside another loop is called:

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

D

This may be used to write information to a file.

(Multiple Choice)
4.9/5
(87)

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

(Multiple Choice)
4.7/5
(79)

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

(True/False)
4.7/5
(87)

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

(Multiple Choice)
4.9/5
(80)

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.8/5
(77)

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

(Multiple Choice)
5.0/5
(69)

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

(Multiple Choice)
4.8/5
(83)

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
(71)

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

(Multiple Choice)
4.9/5
(73)

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

(True/False)
5.0/5
(88)

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

(True/False)
4.8/5
(90)

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

(Multiple Choice)
4.8/5
(74)

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

(True/False)
4.9/5
(75)

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
(72)

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

(Multiple Choice)
4.9/5
(90)

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

(Multiple Choice)
4.9/5
(82)

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

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

Filters

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