Programing Logic Exam 3

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/69

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

70 Terms

1
New cards

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.

2
New cards

Element:

an item in the array. are contiguous in memory. Each is the same data type and the same size.

3
New cards

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.

4
New cards

Flag:

a variable that indicates whether an event occurred.

5
New cards

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.

6
New cards

Array In bounds:

using a subscript that is within the acceptable range for the array.

7
New cards

Array Out of bounds:

using a subscript that is not within the acceptable range for the array.

8
New cards

What does it mean to populate an array?

Assigning data values to an element in an array. 

9
New cards

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.

10
New cards

upper bound:

the last element that may be stored in the array.

11
New cards

lower bound:

the first element that may be stored in the array, or 0.

12
New cards

.Length:

In Visual Basic, after you declare the array called Source, its size is automatically stored in a field called Source.Length

13
New cards

An array must be ________ before it can be used.

declared

14
New cards

Each element in a seven-element array can hold _____ value(s).

one

15
New cards

When working with arrays, the term _________ is a synonym of the word subscript, and is used to describe the same thing.

index

16
New cards

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)

17
New cards

Method:

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

18
New cards

Method header:

also called the declaration or definition.

19
New cards

Method body:

Contains the implementation (Statements that carry out the tasks).

20
New cards

Method return statement:

Returns control to the calling method.

21
New cards

Local Variables and constants:

declared in a method.

22
New cards

Global Variables and constants:

known to all program modules.

23
New cards

When methods must share data:

Pass the data into and return the data out of methods.

24
New cards

Argument to the method:

Pass a data item into a method from a calling program.

25
New cards

Parameter to the method:

Method receives the data item.

26
New cards

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.

27
New cards

Signature:

Method’s name and parameter list.

28
New cards

Passed by value:

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

29
New cards

Creating Methods that Require Parameters.

Passed by value. Each time a method executes, parameter variables listed in the method header are redeclared.

30
New cards

A variable declared within a method ceases to exist when the method

Goes out of scope.

31
New cards

To retain a value that exists when a method ends,

return the value from the method back to the calling method.

32
New cards

Overhead refers to

the extra resources and time required by an operation, such as calling a method.

33
New cards

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.

34
New cards

Indicate that a method parameter must be an array.

Place square brackets after the data type in the method’s parameter list.

35
New cards

Method can also return nothing.

Return type void, Void method.

36
New cards

Overload a method:

Write multiple methods with a shared name but different parameter lists.

37
New cards

Polymorphism:

Ability of a method to act appropriately according to the context.

38
New cards

Ambiguous methods:

Situations in which the compiler cannot determine which method to use.

39
New cards

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.

40
New cards

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.

41
New cards

a black box is

A hidden implementation. You can examine what goes in and out but not how it works.

42
New cards

Cohesion:

How the internal statements of a method serve to accomplish the method’s purpose.

43
New cards

Coupling:

A measure of the strength of the connection between two program methods.

44
New cards

Recursion:

Occurs when a method is defined in terms of itself. Calls itself.

45
New cards

a method is called a ________ in visual basic.

procedure

46
New cards

Sub Procedures

do not return a value back to their calling procedure.

47
New cards

Function Procedures

do return a value back to their calling procedure. you have to indicate the type of data it will return.

48
New cards

A program can contain a method that

calls another method.

49
New cards

When an array is passed to a method, it is _____.

passed by reference

50
New cards

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

51
New cards

Class:

Describes a group or collection of objects with common attributes.

52
New cards

Object:

One instance of a class. Sometimes called one instantiation of a class. When a program creates an object, it instantiates the object.

53
New cards

Attributes:

Characteristics that define an object as part of a class.

54
New cards

Class Methods:

Actions that alter, use, or retrieve the attributes.

55
New cards

Class’s instance variables:

Data components of a class that belong to every instantiated object, Often called fields.

56
New cards

State:

A set of all the values or contents of a class object’s instance variables.

57
New cards

Every object that is an instance of a class possesses the same

methods.

58
New cards

Encapsulation:

The process of combining all of an object’s attributes and methods into a single package.

59
New cards

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.

60
New cards

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.

61
New cards

Work method (also called help method, or faciltator):

performs tasks within a class.

62
New cards

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.

63
New cards

Static methods (also called class methods):

Methods for which no object needs to exist.

64
New cards

Nonstatic methods:

Methods that exist to be used with an object.

65
New cards

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.

66
New cards

When methods have ____, other programs and methods may use the methods to get access to the private data.

public access

67
New cards

When you have a five element array and use subscript 6

your subscript is said to be out of bounds.

68
New cards

Methods in object-oriented programs can use

sequence, selection, and looping structures and make use of arrays.

69
New cards

A linear array, is a

list of finite numbers of elements stored in the memory. can store only homogeneous data elements.

70
New cards

A(n) ____ consists of a rectangle divided into three sections.

class diagram