CS113 - Ch09 Review - Advanced Modularization Techniques

7 September 2022
4.7 (114 reviews)
53 test answers

Unlock all answers in this set

Unlock answers (49)
question
IPO
answer
A(n) ____________________ chart is a tool that identifies and categorizes each item needed within the method as pertaining to input, processing, or output.
question
Argument
answer
A calling method sends a(n) ____ to a called method.
question
A variable declared within a method ceases to exist when the method ends. It goes out of scope. A method can also return "nothing" also known as a void method. A method can return a value when it ends.
answer
Explain what happens when you call a method and the method ends.
question
True
answer
A method's declared return type must match the type of value used in the return statement.
question
False
answer
Programs that use recursion are error-prone but easy to debug.
question
List the three things that you need to know to design effective methods.
answer
What the method does in general. The name of the called method. What type of information to send to the method, if any. What type of return data to expect from the method, if any.
question
Cohesion
answer
____ refers to how the internal statements of a method serve to accomplish the method's purpose.
question
Tight coupling
answer
____ occurs when methods excessively depend on each other and makes programs more prone to errors.
question
Coupling
answer
____ is a measure of the strength of the connection between two program methods.
question
Signature
answer
A method's name and parameter list constitute the method's ____.
question
True
answer
All modern programming languages contain many methods that are predefined.
question
Void
answer
A method can return nothing, in which case the method is a ____ method.
question
Reference
answer
Arrays, unlike simple built-in types, are passed by ____.
question
Looping
answer
Using recursion successfully requires a thorough understanding of ____________________.
question
Nothing, if the method does not pass anything to the method being called. If a method requires data to be passed in, the data items and their types are listed between the parentheses in the method header. (Parameter List)
answer
List the items that must be included within the method declaration's parentheses.
question
Global
answer
When a data item is known to all of a program's modules, it is a ____data item.
question
This is regarding recursion. For these the sum of all the integers up to and including any number is that number plus the sum of the integers for the next lower number.
answer
Discuss the cumulative summing relationship.
question
This occurs when methods do not depend on others. The loosest (best) methods pass single arguments if possible, rather than many variables or entire records.
answer
Discuss loose coupling.
question
Method
answer
A program module that contains a series of statements that carry out a task
question
Method Header
answer
Contains identifying information about the method
question
Passed By Value
answer
A copy of a variable's value is sent to the method and stored in a new memory location accessible to the method
question
Actual Parameters
answer
The arguments sent to a method in a method call
question
Passed By Reference
answer
When the method receives the actual memory address of the array and has access to the actual values in the array elements
question
Polymorphism
answer
The ability of a method to act appropriately according to the context
question
Functional Cohesion
answer
When all the operations in a method contribute to the performance of a single task
question
Tight Coupling
answer
Occurs when methods have access to the same globally defined variables
question
Loose Coupling
answer
Occurs when a copy of data that must be shared is passed from one method to another
question
Overload A Method
answer
​Multiple methods with a shared name but different parameter lists
question
True
answer
When methods must share data, you can pass the data into and return the data out of methods.
question
Polymorphism
answer
____ is the ability of a method to act appropriately depending on the context.
question
Parameter
answer
A called method accepts the value of an argument passed to it as its ____.
question
List the arguments within the method call, separated by commas. List a data type and local identifier for each parameter within the method header's parentheses, separating each declaration with a comma. Even if multiple parameters are the same data type, the type must be repeated with each parameter.
answer
Describe how you create and use a method with multiple parameters.
question
Return
answer
When the method ends at the ____________________ statement, the locally declared parameter variable ceases to exist.
question
Recursive Method
answer
A method that calls itself is a ____.
question
Value
answer
When a copy of a variable is sent to a method, it is passed by ____.
question
Overload
answer
When you ____ a method, you write multiple methods with a shared name but different parameter lists.
question
Formal
answer
The variables in the method declaration that accept the values from the actual parameters are ____ parameters.
question
Parentheses
answer
You can think of the ____ in a method declaration as a funnel into the method.
question
False
answer
A method's return type is part of its signature.
question
Global
answer
When a data item is known to all of a program's modules, it is a(n) ____________________ data item.
question
Recursion
answer
____ occurs when a method is defined in terms of itself.
question
Black Box
answer
Programmers refer to hidden implementation details as existing in a(n) ____________________.
question
True
answer
You can invoke or call a method from another program or method.
question
Interface To The Method
answer
Using implementation hiding means that the ____ is the only part of a method with which the method's client interacts.
question
Redeclared
answer
Each time a method executes, any parameter variables listed in the method header are ____.
question
False
answer
The input value that makes the recursion stop is called the base case or ending case.
question
IPO Charts
answer
____ provide an overview of input to the method, the processing steps that must occur, and the result.
question
True
answer
A method could be called using any numeric value as an argument, whether it is a variable, a named constant, or a literal constant.
question
In Scope
answer
Variables and constants are ____ within, or local to, only the method in which they are declared.
question
True
answer
In implementation hiding, the calling method needs to understand only the interface to the method that is called and it need not know how the method works internally.
question
Overhead
answer
Programmers use the term ____ to describe any extra time and resources required by an operation.
question
Stack
answer
Every time you call a method, the address to which the program should return at the completion of the method is stored in a memory location called the ____.
question
Receclared
answer
Each time a method executes, any parameter variables listed in the method header are ____.