CS 1336: Chapter 5

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

initialization

In a for statement, this expression is executed only once.

3

Look at the following function prototype: inf myFunction(double, double, double); How many parameter variables does this function have?

int

Look at the following function: int myFunction(double);

True

One reason for using functions is to break programs into manageable units, or modules.

while, for

The [x] and [y] loops will not iterate if their test expressions are false to start with.

continue

The ______ statement causes a loop to skip the remaining statements in the current iteration.

break

The ______ statement causes a loop to terminate immediately.

increment

This means to increase a value by one.

break

This statement causes a loop to terminate early.

decrement

To ______ means to decrease it by one.

increment

To ______ means to increase it by one.

<fstream>

To allow file access in a program, you must #include this header file.

True

You may use the exit() function to terminate a program, regardless of which control mechanism is executing.

False

A function's return data type must be the same as a function's parameter(s).

False

A local variable and a global variable may not have the same name within the same program.

infinite

A loop that does not have a way of stopping is a(n) ______ loop.

nested loop

A loop that is inside another is called a ______.

body

A statement or block that is repeated is known as the ______ of the loop.

True

A static variable that is defined within a function is initialized only once, the first time the function is called.

sentinel

A(n) ______ is a special value that marks the end of a series of values.

closes a file

Assuming dataFile is a stream object, the statement: dataFile.close();

outfile << number;

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

iteration

Each repetition of a loop is known as a(n) ______.

initialization, test, update

Inside the for loop's parentheses, the first expression is the [x] , the second expression is the [y], and the third expression is the [z].

True

It is possible for a function to have some parameters with default arguments and some without.

False

Local int variables are initialized to zero (0) by default.

pre-test

The while loop is a ______ loop.

sentinel

This is a special value that marks the end of the list of values.

continue

This loop may be used to stop a loop's current iteration and begin the next one.

ifstream

To read data from a file, you define an object of this data type.

ofstream

To write data to a file, you define an object of this data type.

False

When a function is called, flow of control moves the function's prototype.

False

You must furnish an argument with a function call.


Ensembles d'études connexes

Principles of Real Estate 1 Study Guide

View Set

ACG2071 - Chapter 2: Job Costing: Calculating Product Costs

View Set

Chapter 36: Management of patients with musculoskeletal disorders

View Set

Chapter 7 - Optimal Risky Portfolios

View Set

Scientific Method/ Independent and Dependent variable

View Set