Chapter 6 - Modularizing Your Code with Methods

Ace your homework & exams now with Quizwiz!

T/F: The contents of variables and the values of expressions cannot be passed as arguments

False

T/F:You do not have to write the data type for each parameter variable thats declared n a parameter list if they are all of the same data type

False

A method's _________________ is the type of value that the method returns

Return Type

T/F: Diving a large problem into several smaller problems that are easily solved is sometimes called divide and conquer

True

T/F: If a method belongs to a class, then you must write a method's definition inside the class

True

Pieces of data that are sent into a method are known as _____________.

arguments

Writing the code to perform a task once and them reusing it each time you need to perform the task is a benefit of using methods called ______________.

code reuse

When a ______________ provided for a parameter, it becomes possible to call the method without explicitly passing an argument into the parameter

default argument

A boolean method returns either yes or no

false

T/F: An output parameter works like a by value parameter

false

The ________________ is a collection of statements enclosed inside a set of curly braces that are performed when the method is executed

method body

The __________________, which appears at the beginning of a method definition, lists several important things about the method, including the method's name.

method header

In general terms, a program that is broken into smaller units of code, such as methods, is known as a ____________.

modularized program

A ________________ specifies which parameter an argument should be passed into

named argument

An __________________ can have an uninitialized value passed into it, but must be set to some value before the method it belongs to finishes executing

output parameter

A _______________ is a special variable that recieves an argument when a method is called.

parameter variable

When you want a method to be able to change the value of a variable that is passed to it as an argument, the variable must be ____________.

passed by reference

When an argument is _______________, only a copy of the argument's value is passed into the parameter variable

passed by value

A _______________ a special type of parameter variable that is useful for establishing two-way communication between methods

reference parameter

The _______________ is the memory address that is saved by the system when a method is called and is the location to which the system should return after a method ends.

return point

Programmers commonly use a technique known as ____________ to break down an algorithm into methods

top - down design

T/F: a value-returning method must contain a return statement

true

When you call a _____________, it simply executes the statements it contains and then terminates.

void method


Related study sets

personality psychology test one!! :)

View Set

GEB1101:M1-C1.2.3.4: Environment of Business & Business Ownership

View Set

Ch 17 Labor & Birth Complications (FINAL)

View Set

N115: Week 2:: CNS Pharmacology Objectives and Study Questions

View Set