CS 354: EXAM 1 QUESTIONS WITH 100% CORRECTLY SOLVED
ANSWERS.
1) Function -- Answer ✔✔ a module of code, similar to Java methods
t t t t t t t t t t t
2) Caller function -- Answer ✔✔ start new functions
t t t t t t t
3) Callee function -- Answer ✔✔ function being called
t t t t t t t
4) Command line arguments -- Answer ✔✔ a white space separated list of input entered
t t t t t t t t t t t t t
after the command prompt
t t t t
5) Program arguments -- Answer ✔✔ follows after the program name (e.g. file names,
t t t t t t t t t t t t t
options that select specific behavior)
t t t t
6) Structure -- Answer ✔✔ - defines a new type in C/C++
t t t t t t t t t t
- describes a compound unit of storage having parts called data members whose t t t t t t t t t t t t
values can change t t
- is accessed using its identifier and member selection to get a particular data
t t t t t t t t t t t t t
member
- when allocated it’s a contiguous fixed size block of memory
t t t t t t t t t
7) Dot operator -- Answer ✔✔ does member access
t t t t t t t
8) Points to operator -- Answer ✔✔ does dereferencing first and the member selection
t t t t t t t t t t t t
9) Format string -- Answer ✔✔ contains format specifier and chars to skip
t t t t t t t t t t t
10) Format specifiers -- Answer ✔✔ - %d %f %p %s %i
t t t t t t t t t t
- each format specifier must match type of destination var
t t t t t t t t
, 11) Whitespace -- Answer ✔✔ - input specifiers (spaces, tab, newline) t t t t t t t t t
- leading white space is skipped t t t t
12) Format string -- Answer ✔✔ - contains format specifiers and char to display
t t t t t t t t t t t t
- \n to flush output buffer t t t t
- each format specifier must match source var t t t t t t
13) Global variable -- Answer ✔✔ - declared outside any function
t t t t t t t t t
- accessible to all functions in the source file t t t t t t t
- allocated in the data segment before execution begins t t t t t t t
14) Static local variable -- Answer ✔✔ - declared inside a function with "static" modifier
t t t t t t t t t t t t t
- accessible only within its function t t t t
- allocated in the data segment t t t t
15) Shadowing -- Answer ✔✔ - when local variable has same name as global variable
t t t t t t t t t t t t t
- blocks access to global var with same name t t t t t t t
16) Argument -- Answer ✔✔ data "values" caller passes to callee
t t t t t t t t t
17) Parameter -- Answer ✔✔ variable where callee stores caller's args
t t t t t t t t t
18) Pass by value -- Answer ✔✔ copy of argument is stored in corresponding parameter
t t t t t t t t t t t t t t
variable
19) Return by value -- Answer ✔✔ a copy of return value replaces function call
t t t t t t t t t t t t t
20) Dangling else -- Answer ✔✔ else pairs with nearest unpaired if, to avoid use braces
t t t t t t t t t t t t t t
21) Scalar variable -- Answer ✔✔ a unit of storage whose contents can change (aka
t t t t t t t t t t t t t t
primative)
22) Identifier -- Answer ✔✔ name associated with variables address in memory
t t t t t t t t t t
23) Value -- Answer ✔✔ data stores in variables memory
t t t t t t t t
ANSWERS.
1) Function -- Answer ✔✔ a module of code, similar to Java methods
t t t t t t t t t t t
2) Caller function -- Answer ✔✔ start new functions
t t t t t t t
3) Callee function -- Answer ✔✔ function being called
t t t t t t t
4) Command line arguments -- Answer ✔✔ a white space separated list of input entered
t t t t t t t t t t t t t
after the command prompt
t t t t
5) Program arguments -- Answer ✔✔ follows after the program name (e.g. file names,
t t t t t t t t t t t t t
options that select specific behavior)
t t t t
6) Structure -- Answer ✔✔ - defines a new type in C/C++
t t t t t t t t t t
- describes a compound unit of storage having parts called data members whose t t t t t t t t t t t t
values can change t t
- is accessed using its identifier and member selection to get a particular data
t t t t t t t t t t t t t
member
- when allocated it’s a contiguous fixed size block of memory
t t t t t t t t t
7) Dot operator -- Answer ✔✔ does member access
t t t t t t t
8) Points to operator -- Answer ✔✔ does dereferencing first and the member selection
t t t t t t t t t t t t
9) Format string -- Answer ✔✔ contains format specifier and chars to skip
t t t t t t t t t t t
10) Format specifiers -- Answer ✔✔ - %d %f %p %s %i
t t t t t t t t t t
- each format specifier must match type of destination var
t t t t t t t t
, 11) Whitespace -- Answer ✔✔ - input specifiers (spaces, tab, newline) t t t t t t t t t
- leading white space is skipped t t t t
12) Format string -- Answer ✔✔ - contains format specifiers and char to display
t t t t t t t t t t t t
- \n to flush output buffer t t t t
- each format specifier must match source var t t t t t t
13) Global variable -- Answer ✔✔ - declared outside any function
t t t t t t t t t
- accessible to all functions in the source file t t t t t t t
- allocated in the data segment before execution begins t t t t t t t
14) Static local variable -- Answer ✔✔ - declared inside a function with "static" modifier
t t t t t t t t t t t t t
- accessible only within its function t t t t
- allocated in the data segment t t t t
15) Shadowing -- Answer ✔✔ - when local variable has same name as global variable
t t t t t t t t t t t t t
- blocks access to global var with same name t t t t t t t
16) Argument -- Answer ✔✔ data "values" caller passes to callee
t t t t t t t t t
17) Parameter -- Answer ✔✔ variable where callee stores caller's args
t t t t t t t t t
18) Pass by value -- Answer ✔✔ copy of argument is stored in corresponding parameter
t t t t t t t t t t t t t t
variable
19) Return by value -- Answer ✔✔ a copy of return value replaces function call
t t t t t t t t t t t t t
20) Dangling else -- Answer ✔✔ else pairs with nearest unpaired if, to avoid use braces
t t t t t t t t t t t t t t
21) Scalar variable -- Answer ✔✔ a unit of storage whose contents can change (aka
t t t t t t t t t t t t t t
primative)
22) Identifier -- Answer ✔✔ name associated with variables address in memory
t t t t t t t t t t
23) Value -- Answer ✔✔ data stores in variables memory
t t t t t t t t