PollEverywhere Ch. 5 - 7

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

When the increment operator precedes its operand, as in ++num1, the expression is in this mode. preliminary binary prefix postfix

prefix

A function ______ eliminates the need to place a function definition before all calls to the function header prototype arguement parameter

prototype

When used as parameters, these types of variables allow a function to access the parameter's original argument. reference floating-point counter undeclared

reference

This is a special value that marks the end of a list of values. variable loop sentinel constant

sentinel

A two-dimensional array is like ______ put together. an array and a function several identical arrays two functions two arrays of different types

several identical arrays

The value in this type of local variable persists between function calls. global internal static dynamic

static

To access an array element, use the array name and the element's _______. data type subscript name value

subscript

What is the output of the following code segment? n = 1; while (n <= 5) cout << n << " "; n++; 12345 23456 1234 111...

111...

How many times will the following loop display "Hello"? for (int i = 0; i <= 20; i++) cout << "Hello!" << endl; 20 19 21 an infinite number of times

21

What is the output fo the following program? void showDub(int); int main() { int x = 2; showDub(x); cout << x << endl; return 0; } void showDub(int num) { cout << (num * 2) << " "; } 2 2 4 2 2 4 4 4

4 2

What is the output of the following program? #include <iostream> using namespace std; int getValue(int); int main { int x = 2; cout << getValue(x) << endl; return 0; } int getValue(int num) { return num + 5; } 5 2 7 "getValue(x)"

7

What will the following code display? int number = 6; cout << ++ number << endl; 6 5 7 0

7

Given the following function definition, what is the output fo the following code fragment that calls calc? void calc (int a, int& b) { int c; c = a + 2; a = a * 3; b = c + a; } int main() { int x = 1, y = 2, z = 3; calc(x , y); cout << x << " " << y << " " << z << endl; }

???

True or False. If I have two integer arrays named arrayOne & arrayTwo, I can compare these two arrays like this: if(arrayOne == arraytwo) TRUE FALSE

FALSE

A(n) ______ is information that is passed to a function, and a(n) ________ is information that is received by a function. function call, function header parameter, argument argument, parameter prototype, header

argument, parameter

To pass an array as an argument to a function, pass the _______. contents size, expressed as an integer value of the first element array name none of these

array name

Unlike regular variables, these can hold multiple values. constants named constants arrays floating-point variables

arrays

This statement may be used to stop a loop's current iteration and begin the next one break continue terminate re-iterate

continue

This is a variable that is regularly incremented or decremented each time a loop iterates constant control statement counter null terminator

counter

Which of the following is the correct way to print the first element in the array, named dogs, to the screen? cout.print(dogs); cout << array.dogs(1); cout << array[1]; cout << dogs[1]; cout << array[0]; cout << dogs[0]; cout << array.dogs(0);

cout << dogs[0];

A function ______ contains the statements that make up the function definition prototype call expression

definition

The individual values contained in array are known as ________. parts numbers constants elements

elements

Which is an example of implicit array sizing? float arr[10] = {5, 10, 15, 20}; float arr[10] = {0}; float arr[] = {5, 10, 15, 20}; const int SIZE = 5; float arr[SIZE];

float arr[] = {5, 10, 15, 20};

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

fstream

This is a collection of statements that performs a specific task. infinite loop variable constant function

function

This means to increase a value by one. decrement increment modulus parse

increment

Something within a while loop must eventually cause the condition to become false, or a(n) _____ results. infinite loop null value unexpected exit compiler error

infinite loop

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

int

Which of the following is a valid C++ array definition? int array[10]; float $payments[10]; void numbers[5]; int array[0];

int array[10];

Which shows a full initialization list? int nums[3] = {5, 7, 8, 9, 10}; int nums[10] = {5, 7, 8, 9, 10}; int nums[5] = {5, 7, 8, 9, 10}; int nums[SIZE];

int nums[5] = {5, 7, 8, 9, 10};

This type of variable is defined inside a function and is not accessible outside the function. global reference local counter

local

The do-while loop is considered a(n) _____ loop. pre-test post-test infinite limited

post-test


Ensembles d'études connexes

NCLEX questions from presentations

View Set

Fluid and Electrolyte Practice Quiz

View Set

Indian Independence Movement, 1905-1947

View Set

Physics: Electricity & Magnetism

View Set

Pharmacology Test 3: Renal and Reproductive

View Set

ADN Nursing Level 3, Test 5: Immunity (Tuberculosis, SLE, RA, IBD, MS)

View Set