CS113 - Ch09 Review - Advanced Modularization Techniques

¡Supera tus tareas y exámenes ahora con Quizwiz!

Parameter

A called method accepts the value of an argument passed to it as its ____.

Argument

A calling method sends a(n) ____ to a called method.

Passed By Value

A copy of a variable's value is sent to the method and stored in a new memory location accessible to the method

Void

A method can return nothing, in which case the method is a ____ method.

True

A method could be called using any numeric value as an argument, whether it is a variable, a named constant, or a literal constant.

Recursive Method

A method that calls itself is a ____.

True

A method's declared return type must match the type of value used in the return statement.

Signature

A method's name and parameter list constitute the method's ____.

False

A method's return type is part of its signature.

Method

A program module that contains a series of statements that carry out a task

IPO

A(n) ____________________ chart is a tool that identifies and categorizes each item needed within the method as pertaining to input, processing, or output.

True

All modern programming languages contain many methods that are predefined.

Reference

Arrays, unlike simple built-in types, are passed by ____.

Method Header

Contains identifying information about the method

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.

Describe how you create and use a method with multiple parameters.

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.

Discuss loose coupling.

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.

Discuss the cumulative summing relationship.

Receclared

Each time a method executes, any parameter variables listed in the method header are ____.

Redeclared

Each time a method executes, any parameter variables listed in the method header are ____.

Stack

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 ____.

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.

Explain what happens when you call a method and the method ends.

True

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.

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)

List the items that must be included within the method declaration's parentheses.

Loose Coupling

Occurs when a copy of data that must be shared is passed from one method to another

Tight Coupling

Occurs when methods have access to the same globally defined variables

Black Box

Programmers refer to hidden implementation details as existing in a(n) ____________________.

Overhead

Programmers use the term ____ to describe any extra time and resources required by an operation.

False

Programs that use recursion are error-prone but easy to debug.

Polymorphism

The ability of a method to act appropriately according to the context

Actual Parameters

The arguments sent to a method in a method call

False

The input value that makes the recursion stop is called the base case or ending case.

Formal

The variables in the method declaration that accept the values from the actual parameters are ____ parameters.

Interface To The Method

Using implementation hiding means that the ____ is the only part of a method with which the method's client interacts.

Looping

Using recursion successfully requires a thorough understanding of ____________________.

In Scope

Variables and constants are ____ within, or local to, only the method in which they are declared.

List the three things that you need to know to design effective methods.

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.

Value

When a copy of a variable is sent to a method, it is passed by ____.

Global

When a data item is known to all of a program's modules, it is a ____data item.

Global

When a data item is known to all of a program's modules, it is a(n) ____________________ data item.

Functional Cohesion

When all the operations in a method contribute to the performance of a single task

True

When methods must share data, you can pass the data into and return the data out of methods.

Return

When the method ends at the ____________________ statement, the locally declared parameter variable ceases to exist.

Passed By Reference

When the method receives the actual memory address of the array and has access to the actual values in the array elements

Overload

When you ____ a method, you write multiple methods with a shared name but different parameter lists.

True

You can invoke or call a method from another program or method.

Parentheses

You can think of the ____ in a method declaration as a funnel into the method.

Coupling

____ is a measure of the strength of the connection between two program methods.

Polymorphism

____ is the ability of a method to act appropriately depending on the context.

Recursion

____ occurs when a method is defined in terms of itself.

Tight coupling

____ occurs when methods excessively depend on each other and makes programs more prone to errors.

IPO Charts

____ provide an overview of input to the method, the processing steps that must occur, and the result.

Cohesion

____ refers to how the internal statements of a method serve to accomplish the method's purpose.

Overload A Method

​Multiple methods with a shared name but different parameter lists


Conjuntos de estudio relacionados

Starting Out with Java: From Control Structures through Data Structures, 1e, Chapter 8: Arrays

View Set

Unit IV Recitation Quizzes and Learning Objectives

View Set

Chapter 16: Emotional and Social Development in Middle Adulthood

View Set

Chapter 3. Understanding the Organization's Environment

View Set

Psych EAQs 1-5 Foundations and Practice of Mental Health

View Set