• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/36

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

36 Cards in this Set

  • Front
  • Back

A __________ is a group of statements that exist within a program for the purpose of performing a specific task.

Module

Instead of writing a large program as one long sequence of statements, it can be written as several small modules, each one performing a specific part of the task. This approach is sometimes called _________________________

Divide and Conquer


dividing a large task into several smaller tasks that are easily performed.

Modules are commonly called what?

procedures, subroutines, subprograms, methods, and functions

What are the benefits of using modules?

1.) Simpler Code


2.) Code reuse (you can use the same code to perform repetitive tasks)


3.) Better Testing (each task within a program is contained in its own module, testing and debugging become simpler.


4.) Faster Development


5.) Easier Facilitation of Teamwork (programmers can be assigned the job of writing different modules

Simpler code, code reuse, better testing, faster development, and easier facilitation of teamwork are all benefits of using what?

Benefits of using modules.

The code for a module is known as a ____________ ____________________

Module Definition

Module names can't contain what?

they can't contain spaces, punctuation characters, and usually can't begin with a number

To write a module you write its ________________.

Definition

In most languages, a module has two parts, the ____________ and a __________.

A header and a body.

The ___________ indicates the starting point of the module.

The header

The ________ is a list of statements that belong to the module.

The body

_______________ statements inside a module visually sets them apart. As a result, you can tell at a glance which statements are inside the module.

Indenting

A module definition specifies what a module does, but it does not cause the module to execute. To execute a module, we must ______ ___.

We must call it.

Many programming languages require that programs have a __________ ____________.

Main Module


this is the program's starting point, and it generally calls other modules.

In a flowchart, a module call is shown with a rectangle that has _______ ________ at each side.

A rectangle with vertical bars on the side.

When drawing a flowchart for a module, the starting terminal symbol usually shows the ________ of the module.

name of the module.

Programmers commonly use a technique known as _______-______ design to break down an algorithm into modules.

top-down design.

The top-down design process is sometimes called ___________ ___________________.

Stepwise Refinement

Flowcharts are good tools for graphically depicting the flow of the logic inside a module, but they do not give a visual representation of the relationships between modules. Programmers commonly use _____________ charts for this purpose.

Hierarchy charts.

A hierarchy chart is also called a _____________ chart.

Structure chart.

Describe the top-down design approach

1. The overall task that the program is to perform is broken down into a series of subtasks


2. Each of the subtasks is examined to determine whether it can be further broken down into more subtasks. This step is repeated until no more subtasks can be identified.


3. Once all of the subtasks have been identified, they are written in code.

When the end of the module is reached, the program __________ ________________.

Stops executing

In most programming languages, a variable that is declared inside a module is called a _________ variable.

Local variable.

A local variable belongs to the module in which it is ___________. And only statements inside that module can access the variable.

Declared.

What is meant by the term local (variable)?

The term local is meant to indicate that the variable can be used only locally within the module in which it is declared.

Programmers typically use the word _________ to describe the part of the program in which a variable may be accessed.

Scope


A variable is visible only to statements inside the variable's scope.

A local variable's scope usually begins at the _____________ __________________ and ends at the ________ of the module in which the variable is declared.

begins at the variable's declaration and ends at the end of the module in which the variable is declared.

In most programming languages, you cannot have two ____________ with the same name in the same _____________.

In most programming languages, you cannot have two variables with the same name in the same scope.

Why can't you have two variables with the same name in the same module?

Because the compiler or interpreter would not know which variable to use when a statement tries to access all of them. All variables that exist within the same scope must have unique names.

An _____________ is any piece of data that is passed into a module when the module is called.

An argument.


the module can use its arguments in calculations or other operations.

A ____________ is a variable that receives an argument that is passed into a module.

A parameter.

If you want a module to receive arguments when it is called, you must equip the module with one or more ____________ _____________.

parameter variables.

A parameter variable is often simply called a _____________.

Parameter

When you pass an argument to a module, most programming languages require that the argument and the receiving parameter variable be of the ______ __________ type.

Same data type.

Some languages allow you to pass an argument into a parameter variable of a different type as long as no _____ will be lost.

data will be lost.

What is a parameter variable's scope?

usually the entire module in which the parameter is declared.