Assessment 2
A module can have two or more variables with the same name because they are within the same scope. TRUE/FALSE
False
The scope of the parameter variables is the entire program and they are visible to any statement in the program. TRUE/FALSE
False
Which of the following is NOT a benefit of using modules when developing a program? They make programs easier to debug. They make program development faster. Programs which contain modules always run faster than programs without modules. Module code can be reused.
Programs which contain modules always run faster that programs without modules.
An attempt to pass a non-variable argument into a reference variable parameter will cause an error. TRUE/FALSE
True
Modules can be written for commonly needed tasks, and those modules can be incorporated into each program that needs them. TRUE/FALSE
True
The arguments in a module call and the parameters listed in the module header must be of compatible data types. TRUE/FALSE
True
The scope of a variable is the segment of the program in which the variable can be accessed. TRUE/FALSE
True
When a variable is passed by reference to a module, changes to the value of the argument in the module will also affect the variable in the part of the program that sent that argument. TRUE/FALSE
True
An argument that is passed by __________ is not affected by a change to the content of the parameter variable.
Value
Which of the following would a programmer use to visualize the relationship between modules? pseudocode a flowchart a modular chart a hierarchy chart
a hierarchy chart
A module definition consists of the module header and the module ___________.
body
To execute a module, you must _________.
call it
To create a module, you write its __________.
definition
Another name for a module is a(n) __________.
function
A variable is visible to every module and the entire program.
global
The use of _____ variables may make programs hard to understand and debug.
global
A ____________ is a variable that receives an argument which is passed to a module.
parameter
In a flowchart, a module call is represented by a(n) __________ symbol with vertical bars at each side.
rectangle
When an argument is passed by __________, the parameter receives the address of the argument so both the argument and the parameter point to the same memory location.
reference
When an argument is passed by _________, only a copy of the argument's value is passed into the parameter variable.
value