Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
10 Cards in this Set
- Front
- Back
how does the use of function arguments make it possible to write larger, more useful programs? |
3. Function arguments are used to passinformation between the separate modules of a program and between the mainfunction and its modules. Arguments make it easier for a function to be reusedby other functions or programs. Functions with arguments are building blocksfor constructing larger programs. |
|
What error message do you get if a function prototype has a different number of parameters than the function definition? |
5. The syntax error “Too few argumentsfor function ‘functionName’ (or Too many arguments … ) |
|
x is 15, and y is 10. What are values of.. x !=y | x < y | x>=y-x | x == (y + x - y) |
true, false, true, true |
|
What does the following display when x is 10? when x is 20? and part b? if( x < 12) cout << "less" << endl; else cout <<"done" << endl; AND var1 = 15.0; var2 = 25.12; if( 2 * var1 >= var2) cout << "O.K."" << endl; else cout << "not ok." << endl; |
A: if x is 10 then output is "less". if 20, then output is "done". B: output is "ok" |
|
Placing braces question |
would cause it to display the value of y only when x <= y |
|
What are the benefits of using constant identifiers instead of literals in a program? |
Program is more readable and easier to modify |
|
What will be printed by the following carelessly constructed switch statement if the value of color is 'R'? Fix the error switch(color) { case 'R' : case 'r' : cout << "red" << endl; case 'B' : case 'b': cout << "blue" << endl; case 'Y' : case 'y': cout << "yellow" << endl; } |
red blue yellow switch(color) { case 'R' : case 'r': cout << "red" << endl; break; case 'B': case 'b': cout << "blue" << endl; break; case 'Y' : case 'y': cout << "yellow" << endl; default: cout << "color not determined" << endl; }
|
|
ftype fname(arguements) |
also looks like void nonsense(5, 6) |
|
using && both operands need to be what to be true? |
True, True |
|
using || both operands need to be what to be false? |
only false + false = false. True + anything = true. |