c++ 2 unit 1 quiz

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

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.

several identical arrays

A two-dimensional array is like ________ put together.

begins with zero

Subscript numbering in C++________.

false

Suppose list is a one dimensional array of size 25, wherein each component is of type int. Further, suppose that sum is an int variable. The following for loop correctly finds the sum of the elements of list. sum = 0; for (int i = 0; i < 25; i++) sum = sum + list;

for (j = 0; j <= 50; j++) cout << gamma[j] << " ";

Suppose that gamma is an array of 50 components of type int and j is an int variable. Which of the following for loops sets the index of gamma out of bounds?

elements

The individual values contained in array are known as ________.

memory address

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

0 5 10 15 20

What is the output of the following C++ code? int list[5] = {0, 5, 10, 15, 20}; int j; for (j = 0; j < 5; j++) cout << list[j] << " "; cout << endl;

5

What is the value of alpha[2] after the following code executes? int alpha[5]; int j; for (j = 0; j < 5; j++) alpha[j] = 2 * j + 1;

reference

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

global variable

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

constant integer expression, zero

An array's size declarator must be a ________ with a value greater than ________.

subscript

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

sales[index]

Complete the following statement so that it outputs the array sales. double sales[10]; int index; for (index = 0; index < 10; index++) cout << ____________________ << " ";

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.

document

It is a good programming practice to ________ your functions by writing comments that describe what they do.

int

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

static local

The value in a ________ variable persists between function calls.

static

The value in this type of local variable persists between function calls.

function

This is a collection of statements that performs a specific task.

stub

This is a dummy function that is called instead of the actual function it represents.

return

This statement causes a function to end.

a loop to assign the elements of one array to the other array

To assign the contents of one array to another, you must use ________.

name

To pass an array as an argument to a function, pass the ________ of the array.


Set pelajaran terkait

Chapter Exam - Life Premiums and Benefits

View Set

Points, Suspension and Insurance Quiz

View Set

Critical Thinking - Communication-Cognition

View Set

Chapter 53: Female Reproductive and Genital Problems

View Set

print reading chapter 13 through 18

View Set

life and health insurance exam konnor

View Set

Chapter 41 a&p Nutrition and Metabolism

View Set