1/69
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Array:
A series or list of variables in computer memory. All variables share the same name, and must be the same data type. Each variable has a different subscript.
Element:
an item in the array. are contiguous in memory. Each is the same data type and the same size.
Subscripts:
Position number of an item in an array starting from 0 to one less than the number of elements in array. are always a sequence of integers.
Flag:
a variable that indicates whether an event occurred.
Parallel arrays:
Two arrays, each with six elements. Each element in one array is associated with an element in the same relative position in the other array.
Array In bounds:
using a subscript that is within the acceptable range for the array.
Array Out of bounds:
using a subscript that is not within the acceptable range for the array.
What does it mean to populate an array?
Assigning data values to an element in an array.
Explain why programmers often use for loops in place of while loops to loop through an array.
It is used because we know the amount of times it will execute, due to the number of elements in the array.
upper bound:
the last element that may be stored in the array.
lower bound:
the first element that may be stored in the array, or 0.
.Length:
In Visual Basic, after you declare the array called Source, its size is automatically stored in a field called Source.Length
An array must be ________ before it can be used.
declared
Each element in a seven-element array can hold _____ value(s).
one
When working with arrays, the term _________ is a synonym of the word subscript, and is used to describe the same thing.
index
In the Visual Basic programming language, which of the following expressions is used to select the eighth element of an array called items?
items(7)
Method:
A program module that contains a series of statements that carry out a task.
Method header:
also called the declaration or definition.
Method body:
Contains the implementation (Statements that carry out the tasks).
Method return statement:
Returns control to the calling method.
Local Variables and constants:
declared in a method.
Global Variables and constants:
known to all program modules.
When methods must share data:
Pass the data into and return the data out of methods.
Argument to the method:
Pass a data item into a method from a calling program.
Parameter to the method:
Method receives the data item.
When a method receives a parameter, you must provide a parameter list that includes:
The type of the parameter. The local name for the parameter.
Signature:
Method’s name and parameter list.
Passed by value:
A copy of a value is sent to the method and stored in a new memory location accessible to the method.
Creating Methods that Require Parameters.
Passed by value. Each time a method executes, parameter variables listed in the method header are redeclared.
A variable declared within a method ceases to exist when the method
Goes out of scope.
To retain a value that exists when a method ends,
return the value from the method back to the calling method.
Overhead refers to
the extra resources and time required by an operation, such as calling a method.
IPO chart:
A tool that identifies and categorizes each item in a method by input, processing, and output. A method that finds the smallest of three numeric values.
Indicate that a method parameter must be an array.
Place square brackets after the data type in the method’s parameter list.
Method can also return nothing.
Return type void, Void method.
Overload a method:
Write multiple methods with a shared name but different parameter lists.
Polymorphism:
Ability of a method to act appropriately according to the context.
Ambiguous methods:
Situations in which the compiler cannot determine which method to use.
Every time you call a method:
Compiler decides whether a suitable method exists. If so, the method executes. If not, you receive an error message.
Implementation hiding:
Encapsulation of method details. When a program makes a request to a method, it does not know the details of how the method is executed.
a black box is
A hidden implementation. You can examine what goes in and out but not how it works.
Cohesion:
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.
Recursion:
Occurs when a method is defined in terms of itself. Calls itself.
a method is called a ________ in visual basic.
procedure
Sub Procedures
do not return a value back to their calling procedure.
Function Procedures
do return a value back to their calling procedure. you have to indicate the type of data it will return.
A program can contain a method that
calls another method.
When an array is passed to a method, it is _____.
passed by reference
When a method receives a copy of the value stored in an argument used in the method call, it means the variable was _____.
passed by value
Class:
Describes a group or collection of objects with common attributes.
Object:
One instance of a class. Sometimes called one instantiation of a class. When a program creates an object, it instantiates the object.
Attributes:
Characteristics that define an object as part of a class.
Class Methods:
Actions that alter, use, or retrieve the attributes.
Class’s instance variables:
Data components of a class that belong to every instantiated object, Often called fields.
State:
A set of all the values or contents of a class object’s instance variables.
Every object that is an instance of a class possesses the same
methods.
Encapsulation:
The process of combining all of an object’s attributes and methods into a single package.
Set method (also called mutator method):
Sets the values of data fields within the class. No requirement that such methods start with the set prefix. Some languages allow you to create a property to set field values instead of creating a set method.
Get method (also called accessor method):
Purpose is to return a value to the world outside the class. Value returned from a get method can be used as any other variable of its type would be used.
Work method (also called help method, or faciltator):
performs tasks within a class.
this reference:
An automatically created variable. Holds the address of an object. Passes it to an instance method whenever the method is called. Refers to “this particular object” using the method. Implicitly passed as a parameter to each instance method.
Static methods (also called class methods):
Methods for which no object needs to exist.
Nonstatic methods:
Methods that exist to be used with an object.
You can use objects
like you would use any other simpler data type. Pass to an object to a method. Return an object from a method. Use an array of objects.
When methods have ____, other programs and methods may use the methods to get access to the private data.
public access
When you have a five element array and use subscript 6
your subscript is said to be out of bounds.
Methods in object-oriented programs can use
sequence, selection, and looping structures and make use of arrays.
A linear array, is a
list of finite numbers of elements stored in the memory. can store only homogeneous data elements.
A(n) ____ consists of a rectangle divided into three sections.
class diagram