Exam 2 Review

¡Supera tus tareas y exámenes ahora con Quizwiz!

Consider the following: char message[35] = "Like tears in the rain"; int length; length = strlen(message); Then the value of 'length' is __________.

22

The code cout << toupper('b'); causes a __________ to be displayed on the screen.

B

Consider the code: char string1[30] = "In the Garden"; char string2[15] = "of Eden"; strcat(string1, string2); cout << string1; The output for this is __________.

In the Gardenof Eden

__________ parameters are found in the call to a function.

actual

In C++ a block boundary is defined with a pair of __________.

braces

A prototype must give the __________ of its formal parameters and may give their __________.

data type, name

The amount of memory allocated to an array is based on the __________ and the __________ of locations or size of the array.

data type, number

An operator that deallocates a dynamic variable is __________.

delete

In C++, a string constant must be enclosed in __________ whereas a character constant must be enclosed in __________.

double-quotation marks, single- quotation marks

A(n) __________ is a program that tests a function by simply calling it.

driver

__________ parameters are found in the function heading.

formal

A __________ tells the compiler about a function's name, return type, and parameters

function definition

A __________ is a declaration of a function that specifies the function's name and type signature, but omits the body.

function prototype

In C++ all functions have __________ scope.

global

Upon exiting a loop that reads values into an array, the variable used as a(n) __________ to the array will contain the size of that array.

index or subscript

__________ checks if a character is alphanumeric

isalnum

__________ checks if a character is a letter of the alphabet.

isalpha

__________ checks if a character is a digit.

isdigit

__________ checks if a character is lower case.

islower

__________ checks if a character is printable.

isprint

__________ checks if a character is punctuation.

ispunct

__________ checks if a character is a blank space.

isspace

__________ checks if a character is upper case.

isupper

Array initialization and processing is usually done inside a __________.

loop

An n-dimensional array will be processed within __________ nested loops when accessing all members of the array.

n

A call must have the __________ of its actual parameters and must NOT have the name __________ of those parameters.

name, data type

Multi-dimensional arrays are usually processed within __________ loops.

nested

An operator that allocates a dynamic variable is __________.

new

The end of a string is marked in computer memory by the __________.

null character \n

In passing an array as a parameter to a function that processes it, it is often necessary to pass a parameter that hold the __________ of __________ used in the array.

number, elements

__________ functions are functions that have the same name but a different parameter list.

overloaded

Arrays used as arguments are always passed by __________.

pointer

The name of an array, without any brackets, acts as a(n) __________ to the starting address of the array.

pointer or reference

Functions that do not return a value are often called _________ in other programming languages.

procedures

Default arguments are usually defined in the __________ of the function.

prototype

A function returning a value should never use pass by __________ parameters.

reference

Default values are generally not given for pass by __________ parameters.

reference

Parameters that are passed by __________ are similar to a pointer variable in that they can contain the address of another variable. They are used as parameters of a procedure (void function) whenever we want a procedure to change the value of the argument.

reference

Pass by __________ indicates that the location of an actual parameter, rather than just a copy of its value, is passed to the called function.

reference

Every function that begins with a data type in the heading, rather than the word 'void', must have a(n) __________ statement somewhere, usually at the end, in its body of instructions.

return

__________ refers to the region of a program where a variable is "active."

scope

The vector data type is a(n) __________ container.

sequence

Variables of a function that retain their value over multiple calls to the functions are called _________ variables.

static

A(n) __________ is a dummy of function that just indicates that a function was called properly.

stub

Pass by __________ indicates that a copy of the actual parameter is placed in the memory of location of its corresponding formal parameter.

value

The word __________ precedes the name of every function prototype and heading that does not return a value back to the calling routine.

void

In cin.getLine(name, 25) the 25 indicates that the user can input at most __________ characters into 'name'.

24

The __________ header file must be included to acces the 'islower' and 'isspace' character functions.

<cctype>

The data type returned by isalpha('g') is __________.

boolean

__________ is a c-string function that concatenates strings.

strcat

The code cout << tolower('#'); causes a __________ to be displayed on the screen.

#

A __________ after a data type in the function heading and in the prototype indicates that the parameter will be passed by reference.

&

The __________ symbol means "address of."

&

The __________ symbol is the dereferencing operator.

*

After the assignment statement result = isdigit('$'), 'result' has the value __________.

0

The first subscript of every array in C++ is __________ and the last is __________ less than the total number of locations in the array.

0, one


Conjuntos de estudio relacionados

P.T. Nutritionalist Chapter Quizzes

View Set

Lesson 1: Choosing Language for Context and Purpose

View Set

Emergency Preparedness Response Course (EPRC) CBRN for Medical Personnel and First Responders (4 hours)

View Set

Macro - 3.2 Shifts in Demand and Supply for Goods and Services

View Set

Monopolistic Competition/ Oligopoly

View Set