Programming Intro terms

Ace your homework & exams now with Quizwiz!

Client

A program or other method that uses the method

primitive data types

Are simple numbers and characters that are not class types

Object-oriented programming (OOP)

Programming model that focuses on an application's components and data and the methods you need to manipulate them

Parameter to a Method

a data item defined in a method header that accepts data passed into the method from the outside

Cohesion

a measure of how the internal statements of a method serve to accomplish the method's purpose

Functional cohesion

a measure of how the internal statements of a method serve to accomplish the method's purpose

Coupling

a measure of the strength of the connection between two program methods

Stack

a memory area that holds addresses to which methods should return

Recursive Method

a method that calls itself

While loop

a process continues while some condition continues to be true.

method

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

class client (class user)

a program or class that instantiates objects of another prewritten class

Abstract Data Type (ADT)

a programmer-defined type, such as a class

Implementation Hiding

a programming principle that describes the encapsulation of method details

class definition

a set of program statements that define the fields and methods for a class

class method

a static method; it is not an instance method, and it does not receive a this reference

user-defined type (programmer-defined type)

a type that is not built into a language but is created by an application's programmer

Argument to a Method

a value passed to a method in the call to the method

Passed By Value

a variable passed into a method;that is, a copy of its value is sent to the method and stored in a new memory location accessible to the method

A sequence structure can contain _______. a. any number of tasks b. exactly three tasks c. no more than three tasks d. only one task

a. any number of tasks

Attaching structures end to end is called ________. a. stacking b. untangling c. building d. nesting

a. stacking

Parameter List

all the data types and parameter names that appear in a method header

this reference

an automatically created variable that holds the address of an object and passes it to an instance method whenever the method is called

set method (mutator method)

an instance method that sets or changes the value of a data defined in a class

instantiation of a class

an instance or an object

Repetition and Iteration

are alternate names for a loop structure.

nonstatic methods

are methods that exist to be used with an object; they are instance methods and receive a this reference

Structured programs

are programs that do follow the the rules of structured logic.

Unstructured programs

are programs that do not follow the rules of structured logic.

Which of the following attributes do all three basic structures share _________. a. Their flowcharts all contain exactly three processing symbols. b. They all have one entry and one end point. c. They all contain a decision. d. They all begin with a process.

b. They all have one entry and one end point.

The statement while temperature remains below 60, leave the furnace on is an example of a ________. a. sequence b. loop c. dual-alternative selection d. single-alternative selection

b. loop

Snarled prgram logic is called _________ code. a. snake b. spaghetti c. string d. gnarly

b. spaghetti

The statement if age<13 then movieTicket= 4.00 else movieTicket= 8.50 is an exampleof a _________. a. sequence b. loop c. dual-alternative selection d. single-alternative selection

c. dual-alternative selection

When you input data in a loop within a program, the input statement that precedes the loop _________. a. is the only part of the program allowed to be undstructured b. cannot result in eof c. is called a priming input d. executes hundreds or even thousands of times in most business

c. is called a priming input

The three structures of structured programming are __________. a. sequence, order, and process b. selection, loop, and iteration c. sequence, selection, and loop d. if, else, and then

c. sequence, selection, and loop

class diagram

consists of a rectangle divided into three sections that show the name, data, and methods of a class

Method Body

contains all the statements in the method

Which is true of stacking structures. a. Two incidences of the same structure cannot be stacked adjacently. b. When you stack structures, you cannot nest them in the same program. c. Each structure has only one point where it can be stacked on top of another. d. When you stack structures, the top structure must be a sequence.

d. When you stack structures, the top structure must be a sequence.

The structure in which you ask a question, and, depending on the answer, take some action and then ask the question again, can be called all of the following __________. a. iteration b. loop c. repetition d. if-then-else

d. if-then-else

Placing a structure within another structure is called _________the structures. a. stacking b. untangling c. building d. nesting

d. nesting

The statement if age >= 65 then seniorDiscount= "yes" is an example of a _________. a. sequence b. loop c. dual-alternative selection d. single-alternative selection

d. single-alternative selection

Recursive Cases

describe the input values that cause a recursive method to execute again

class

describes a group or collection of objects with common attributes

Global

describes data items that are know to all methods in a program

Local

describes data items that are only known to the method in which they are declared

Passed By Reference

describes how values are accepted into a method when the method receives the actual memory address item. Arrays are passed by reference

Implementation

describes the body of a method or the statements that carry out the tasks of a method

Base Case/Terminating Case

describes the value that ends the repetition in a recursive method

End-structure statements

designate the ends of pseudocode structures.

IPO Chart

identifies and categorizes each item needed within the method as pertaining to input, processing, or output

Signature

includes a method's name and parameter list

Interface to a Method

includes the method's return type, name, and arguments; it is the part that a client sees and uses

Return Type

indicates the data type of the value that the method will send back to the location where the method call was made

Overloading

involves supplying diverse meanings for a single identifier

Structure

is a basic unit of programming logic; each structure is a sequence, selection, or loop.

Block

is a group of statements that executes as a single unit.

Goto-less programming

is a name to describe structured programming, because structured programmers do not use a "go to" statement.

get method (accessor method)

is an instance method that returns a value from a field defined in a class

if-then-else

is another name for a selection structure.

Spaghetti code

is snarled, unstructured program logic.

Stacking structures

is the act of attaching structures end to end.

Nesting structures

is the act of placing a structure within another structure.

Null case

is the branch of a decision in which no action is taken.

Priming input

is the statement that reads the first input data record prior to starting a structured loop.

Method Return Statement

marks the end of a method and identifies the point at which control returns to the calling method

fields

object attributes or data

Recursion

occurs when a method is defined in terms of itself

Loose Coupling

occurs when methods do not depend on others

Tight Coupling

occurs when methods excessively depend on each other; it makes programs more prone to errors

object

one tangible example of a class; it is an instance of a class

instance

one tangible example of a class; it is an object

instance method

operates correctly yet differently for each class object. An instance method is nonstatic and receives a this reference

Selection structure

or decision structure, you ask a question, and depending on the answer, you take one or two courses of action. Then, no matter which path you follow, you continue with the next task.

Dual-alternative ifs

or single-alternative selections, define one action to be taken when the tested condition is true and another action to be taken when it is false.

Single-alternatives ifs

or single-alternative selections, take action on just one branch of the decision.

work method (help method or facilitator)

performs tasks within a class

Method Header

precedes a method; includes the method identifier and possibly other necessary identifying information, such as a return type and parameter list

property

provides methods that allow you to get and set a class field value using a simple syntax

Overhead

refers to all the resources and time required by an operation

is-a relationship

relationship between an object and its class

Void Method

returns no value

private access

specifies that data or methods cannot be used by any method that is not part of the same class

public access

specifies that other programs and methods may use the specified data or methods within a class

Polymorphism

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

access specifier

the adjective that defines the type of access outside classes will have to the attribute or methods within a class

Black Box

the analogy programmers use to refer to hidden method implementation details

Actual Parameters

the arguments in a method call

attributes

the characteristics that define an object

Information hiding (data hiding)

the concept that other classes should not alter an object's attributes -- only the methods of an object's own class should have that privilege

class's instance variable

the data components that belong to every instantiated object

Inheritance

the process of acquiring the traits of one's predecessors

Encapsulation

the process of combining all of an object's attributes and methods into a single package

state of an object

the set of all the values or contents of its instance variables

Formal Parameters

the variables in the method declaration that accept the values from the actual parameters

static methods

those for which no object needs to exist; they are not instance methods and they do not receive a this reference

Ambiguous Methods

those methods that the compiler cannot distinguish between because they have the same name and parameter types

instantiate an object

to create it

Overload a Method

to create multiple versions with the same name but different parameter lists.

Loop structure

you continue to repeat actions based on the answer to a question.

Sequence structure

you perform an action or task, and then you perform the next action, in order. A sequence can contain any number of tasks, but there is no option to branch off and skip any of the tasks.


Related study sets

Comprehensive practice exam questions

View Set

All chapters answers call of the wild

View Set

Retirement Planning: Non-Qualified Plans (Module 3)

View Set