CISP 360

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

search

A ________ algorithm is a method of locating a specific item of information in a larger collection of data.

middle

A binary search begins with the ________ element of an array.

opened

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

update

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

definition

A function ________ contains the statements that make up the function.

only one

A function can have zero to many parameters, and it can return this many values.

a nested loop

A loop that is inside another loop is called:

Preprocessor directive

A statement that starts with a # symbol is called a

rows, columns

A two-dimensional array can be viewed as ________ and ________.

Closing brace

For every opening brace in a C++ program, there must be a:

computeValue(10);

Here is the header for a function named computeValue: void computeValue(int value) Which of the following is a valid call to the function?

persist

If a function is called more than once in a program, the values stored in the function's local variables do not ________ between function calls.

The beginning of a comment

In a C++ program, two slash marks ( // ) indicate:

initialization

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

int

Look at the following function prototype. int myFunction(double); What is the data type of the function's return value?

<

Look at the following statement. while (x++ < 10) Which operator is used first?

assigns the dereferenced pointer's value, then increments the pointer's address

Look at the following statement: sum += *array++; This statement ________.

compare

Relational operators allow you to ________ numbers.

infinite loop

Something within a while loop must eventually cause the condition to become false, or a(n) ________ results.

#include preprocessor directive

The ________ causes the contents of another file to be inserted into a program.

cout object

The ________ is used to display information on the computer's screen.

>>, <<

The ________ operator always follows the cin object, and the ________ operator follows the cout object.

selection, bubble

The ________ sort usually performs fewer exchanges than the ________ sort.

ampersand ( & )

The ________, also known as the address operator, returns the memory address of a variable.

simplicity

The advantage of a linear search is its ________.

cmath

The function, pow(x, 5.0), requires this header file.

elements

The individual values contained in array are known as ________.

memory address

The name of an array stores the ________ of the first array element.

integer and floating point

The numeric data types in C++ can be broken into two general categories:

argument, parameter

A(n) ________ is information that is passed to a function, and a(n) ________ is information that is received by a function.

binary, linear

A(n) ________ search is more efficient than a ________ search.

linear

A(n) ________ search uses a loop to sequentially step through an array.

15

After execution of the following code, what will be the value of input_value if the value 0 is entered at the keyboard at run time? cin >> input_value; if (input_value > 5) input_value = input_value + 5; else if (input_value > 2) input_value = input_value + 10; else input_value = input_value + 15;

True

An array name is a pointer constant because the address stored in it cannot be changed during runtime.

the row subscript of the element, the column subscript of the element

An element of a two-dimensional array is referred to by ________ followed by ________.

sorted

Array elements must be ________ before a binary search can be performed.

True

Assuming myValues is an array of int values, and index is an int variable, both of the following statements do the same thing. cout << myValues[index] << endl; cout << *(myValues + index) << endl;

subscript

By using the same ________ you can build relationships between data stored in two or more arrays.

from lowest to highest value

Data that is sorted in ascending order is ordered ________.

Nine

The statement: cin >> setw(10) >> str; will read up to this many characters into str.

int* ptr = nullptr;

The statement: int *ptr = nullptr; has the same meaning as ________.

implicit array sizing

The statement: int grades[ ] = { 100, 90, 99, 80}; shows an example of:

at least once

The statements in the body of a while loop may never be executed, whereas the statements in the body of a do-while loop will be executed:

significant digits and precision

The total number of digits that appear before and after the decimal point is sometimes referred to as:

pre-test

The while loop is this type of loop.

Literals

These are data items whose values do not change while the program is running.

++ and --

These are operators that add and subtract one from their operands.

prefix increment

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

==

This operator is used in C++ to represent equality.

&&

This operator represents the logical AND.

return

This statement causes a function to end.

switch

This statement uses the value of a variable or expression to determine where the program will branch to.

local

This type of variable is defined inside a function and is not accessible outside the function.

subscript

To access an array element, use the array name and the element's ________.

cstdlib

To use the rand() function, you must #include this header file in your program.

arrays

Unlike regular variables, these can hold multiple values.

20,000

Using a linear search to find a value that is stored in the last element of an array of 20,000 elements, ________ element(s) must be compared.

Declares a pointer variable named num2.

What does the following statement do? double *num2;

false

What is the value of the following expression? true && false

0

What is the value stored at x, given the statements: int x; x = 3 / static_cast<int>(4.5 + 6.4);

That's a high score! This is a test question!

What will the following segment of code output? score = 40; if (score > 95) cout << "Congratulations!\n"; cout << "That's a high score!\n"; cout << "This is a test question!" << endl;

zero

When a relational expression is false, it has the value ________.

overflows

When a variable is assigned a number that is too large for its data type, it:

descending

When an array is sorted from highest to lowest, it is said to be in ________ order.

nesting

When an if statement is placed within the conditionally-executed code of another if statement, this is known as:

The data type of the variable

When the final value of an expression is assigned to a variable, it will be converted to:

the address of the first variable comes before the address of the second variable in the computer's memory

When the less than ( < ) operator is used between two pointer variables, the expression is testing whether ________.

reference

When used as parameters, these types of variables allow a function to access the parameter's original argument.

all but the first dimension

When writing functions that accept multi-dimensional arrays as arguments, ________ must be explicitly stated in the parameter list.

the actual value of the variable whose address is stored in the pointer variable

When you work with a dereferenced pointer, you are actually working with ________.

It allows four spaces for the value in the variable num4.

Which is true about the following statement? cout << setw(4) << num4 << " ";

int array[10];

Which of the following is a valid C++ array definition?

A global variable can have the same name as a variable that is declared locally within a function.

Which of the following statements about global variables is true?

False

With pointer variables you can access, but you cannot modify, data in other variables.

indirectly

With pointer variables, you can ________ manipulate data stored in other variables.

break

Without this statement appearing in a switch construct, the program "falls through" all of the statements below the one with the matching case expression.

definition

You must have a ________ for every variable you intend to use in a program.

getline

________ reads a line of input, including leading and embedded spaces, and stores it in a string object.

Variables

________ represent storage locations in the computer's memory.


Ensembles d'études connexes

chapter 4 test: sensation and perception

View Set

AP Psychology Chapter 8: Development Across the Life Span

View Set

Learning 2.6 : Compare and contrast common computing devices and their purposes

View Set

Differential Reinforcement (RBT)

View Set