C++ ch9 study #2
Help!
|
|
||||
|---|---|---|---|---|---|
| 1.The value of RAND_MAX varies with different systems, but its value is always at least __. | 32,767
🗑
|
||||
| 1.You should ___ the random number generator in each program in which it is used; otherwise it will generate the same series of numbers each time the program is executed. | initialize
🗑
|
||||
| 1.You initialize the random number generator using the ____ function. | srand()
🗑
|
||||
| 1.The srand() function is a ___ function, meaning it doesn't return a value. | void
🗑
|
||||
| 1.The ___ function is a value-returning function that returns the current time(according to your computer systems clock) as seconds elapsed since midnight on January 1, 1970. | time()
🗑
|
||||
| 1.To use the time() function in a program, the program must contain the ____ directive. | #include <ctime>
🗑
|
||||
| 1.In this book, functions you create are referred to as _____ functions, because the function definitions are contained in the program itself rather than in a different file. | program-defined
🗑
|
||||
| The first line in a function definition is called the ____, because it appears at the top of the function. | function header
🗑
|
||||
| 1.A function header doesn't end with a semicolon. TRUE/FALSE? | TRUE
🗑
|
||||
| The ____ store the information passed to the function when the function is invoked. | formal parameters
🗑
|
||||
| 1.The items of information you send(pass) to a function are called ___. | actual arguments
🗑
|
||||
| 1.Passing a variable's value is referred to as _____. | passing by value
🗑
|
||||
| 1.Passing a variables address is referred to as _________. | passing by reference
🗑
|
||||
| 1.Unless you specify otherwise, values in C++ are passed by ____. | value
🗑
|
||||
| 1.The ____ contains the instructions the function must follow to perform its assigned task. | function body
🗑
|
||||
| In most cases, the last statement in the function body of a value returning function is __ | return
🗑
|
||||
| 1.The ___ statement alerts the computer that the function has completed its task. | return
🗑
|
||||
| 1.A _____ is a statement that specifies the function's name, the data type of its return value(if any) and the data type of each of its formal parameters. | function prototype
🗑
|
||||
| 1. The function prototype is usually at the ___ of the program. (beginning, middle, end) | beginning
🗑
|
||||
| 1.The function prototype doesn't end with a semicolon. TRUE/FALSE | FALSE
🗑
|
||||
| 1.The names of the formal parameters do not need to be identical to the names of the corresponding actual arguments. TRUE/FALSE | TRUE
🗑
|
||||
| 1.A(n) variable's ___ indicates where in the program the variable can be used. | scope
🗑
|
||||
| 1.A(n) variable's ___ on the other hand indicates how long the variable remains in the computer's internal memory. | lifetime
🗑
|
||||
| 1.Variables declared within a function and those that appear in a function's parameter list have a local scope and are referred to as _____. | local variables
🗑
|
||||
| ____ are declared outside of any function in the program and they remain in memory until the program ends. | global variables
🗑
|
||||
| 1.A (n)____ function is a function that doesn't return a value after completeing its assigned task. | void
🗑
|
||||
| 1.Each ____ you create in a program has both a value and a unique address that represents the location of the ___ in the computers internal memory. | variable
🗑
|
||||
| 1.Passing by _____ gives the receiving function access to the variable being passed. | reference
🗑
|
||||
| 1.To pass a variable by reference in C++, you include an ampersand(&) called the __ before the name of the corresponding formal parameter in the receiving function's header. | address-of-operator
🗑
|
||||
| 1.The ____ tells the computer to pass the variable's address rather than its contents. | ampersand
🗑
|
||||
| 1.A (n)____ variable also called a ____ variable is one that is unrelated to any other variable in the computers internal memory. | simple, scalar
🗑
|
||||
| 1.A(n) ___ is a group of variables that have the same name and data type and are related in some ways. | array
🗑
|
||||
| 1.An array that can be visualized as a column is a ___. | one dimensional array
🗑
|
||||
| 1.A unique number called a ____ identifies each variable in a one dimensional array. | subscript
🗑
|
||||
| 1.The first variable in a one-dimensional array is assigned a subscript of ___. | 0
🗑
|
Review the information in the table. When you are ready to quiz yourself you can hide individual columns or the entire table. Then you can click on the empty cells to reveal the answer. Try to recall what will be displayed before clicking the empty cell.
To hide a column, click on the column name.
To hide the entire table, click on the "Hide All" button.
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.
To hide a column, click on the column name.
To hide the entire table, click on the "Hide All" button.
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.
Normal Size Small Size show me how
Normal Size Small Size show me how
Created by:
kat1350