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;
173 Cards in this Set
- Front
- Back
Selection structurer |
Used when a programs logic can take 2 paths Also know as an if then else structure |
|
If-then structure |
If the number is greater the 10 add 100 dollars |
|
If-then-else |
When a program has more than one alternate path
If a number is bigger than 10 add 100 dollars..else.. add 50 dollars |
|
Comparison operators |
<>= and the not equals to sign |
|
Boolean Expression |
Value can only be truer of false Every decision a computer program evolves evaluating a Boolean expression Binary |
|
Compound condition |
More than one selection structure to make decisions Multiple questions before determining the outcome |
|
And operator |
And: Evaluates two or more expressions in a single statement One or more AND operators can combine two or more Boolean expressions Requires all Boolean expressions to be true
|
|
Or operator |
Takes action if one of the two is true Requires at least one decision to be true If both half’s false everything is false |
|
Looping Structure |
Makes the computer efficient and useful One set off instructions can work. On multiple data sets Consists of loop body and loop structure Also called a while loop |
|
Loop Body |
Statements who think a loop |
|
Loop Structure |
Started with a test of a Boolean expression Executes as long as the Boolean expression is true |
|
Loop Controlled Variable |
Value tested to control loop’s execution |
|
What three actions that occur when using a loop control variable |
Initialize LCV before entering the loop Test loop controls variable. If true enter loop body Alter LCV in loop body so the while expression eventually evaluates false |
|
Ways to control repetition |
Counter to create a definite loop Sentinel value to create an indefinite loop |
|
Using a definite or controlled loop |
Initiate the counter Enter the while loop Set count number Once Orr hits count it exits the loop and disco plays whatever |
|
What are the methods for changing LCV |
Incriminating adds to variable Decreasing reduced value of a variable, test weather value remains higher than a benchmark value |
|
Using a indefinite loop which a sentinel value |
Looping expression based on a users input Looping be done a different number of times each time its run |
|
Priming input |
First input that sets LCV’s first value |
|
Sentinel value |
Value that signals its time to stope the loop |
|
Using Nesting Loops |
A loop inside another loop Outer loop: loop that contains the other loops or inner loop Used when two or more variables values repeats to produce every combination of values |
|
Loping Mistakes |
Neglecting to initiate the LCV Neglecting to alter the LCV Using the wrong comparison with the LCV Including statements inside the loop that belong outside the loop |
|
Using the For Loop |
Used when the program knows exactly how many times the program will repeat |
|
How does a FOR loop work |
Initiates the LCV Evaluates the LCV Alters the LCV They look different in different languages. Used for accumulating totals or gathering data |
|
Step value |
The amount by which the LCV changes after the body executes Can be positive or negative Does not have to be 1 |
|
Accumulator |
Variable used to gather or accumulate values during repetitions Must be initialized prior to entering the loop value added to current value each time Value is output at end of processing |
|
Array |
Consists of series or list of values All values have the same data type Differentiated with scripts Sometimes refereed to as a table or matrix |
|
Array element |
Each item in an array is know as an element of the array Occupies an area in memory next to the other elements Same group name but unique script |
|
Array Script |
A nonnegative integer that indicates the position of the item. Within the array Also called an index Must be a sequence of integers Usually starts with zero |
|
Array Size |
Indicates number of array elements Determined when the array is declared |
|
Array Declaration |
Declaring structure containing multiple values Variables have the same name and data type |
|
Populating the array |
Assigning values tot he array elements |
|
Array Syntax |
Square brackets usually hold the array elements subscripts |
|
Benefits of using an array |
Ability to use a variable as a subscription to the array Allows loop to cycle through all elements in array Same action taken for each array element Shortens codes |
|
Benefits of using an array |
Ability to use a variable as a subscription to the array Allows loop to cycle through all elements in array Same action taken for each array element Shortens codes |
|
Using constants with arrays |
To hold the size of the array As the array values As a subscript |
|
Linear search |
Search through a list from one end to another |
|
Parallel arrays |
Two arrays in which the elements in the same relative position of the other array |
|
Searching the array for a Range Match |
Range of values - any series of contiguous values between specific limits |
|
Remaining within array bounds |
When accessing array, ensure subscriber accesses location within the array staying Within the array size |
|
Remaining within array bounds |
When accessing array, ensure subscriber accesses location within the array staying Within the array size |
|
Using for lop to process arrays |
Used single statements Easier to use |
|
Modularization |
Smaller part of a larger task Also called methods, subroutines, functions, or procedures |
|
Modularization |
Smaller part of a larger task Also called methods, subroutines, functions, or procedures |
|
Advantages of Modularization |
Provides abstraction Simplifies the logic Allows multiple programmers to work on a problem Allows you to reuse work easily |
|
Modularization |
Smaller part of a larger task Also called methods, subroutines, functions, or procedures |
|
Advantages of Modularization |
Provides abstraction Simplifies the logic Allows multiple programmers to work on a problem Allows you to reuse work easily |
|
Abstraction |
Process of focusing on important properties while ignoring small details Ex: do laundry Doesn’t list every steep like “pick up the laundry basket” |
|
Methods |
Executes a single, finite task Smaller methods are less complex and therefore more reliable |
|
Reusability |
Feature of modular programs that allows methods to be reused |
|
Reliability |
Feature of modular programs that indicates methods have been tested and proved to function properly |
|
Modularizing a program |
Application classes contain a main() method |
|
Parts of a method |
Header: contains method identifier and other information Body:contains all statements in the north of Return statement: marks the end of a method |
|
Flowchart Conversion inn a method |
Method call symbol: a rectangle with a bar across the top Method name goes in the rectangle |
|
Declaring variables and constants in a method |
Usable only within the method Considered local, in-scope, or visible They go out of scope when the method ends |
|
What do you need to know when calling a method |
Name of method What type of information to send to the method if any What type of return data to expect from the method |
|
Argument |
Data item passed into a method from a calling program |
|
Parmeter |
Method receivers the argument into a parameter |
|
Argument and parameters |
Closely related Calling methods sends an argument o a called method Called method accepts the value as its parameter |
|
Methods that can Reciever a single parameter |
Methods that can receive a parameter must include the following information in the headers parentheses - type of parameter - local name for the parameter |
|
Creating a method that requires multiple parameters |
List arguments in method call separate by commas List a data type and local identifier for each parameter in header’s parentheses separated by commas Pass arguments in correct order |
|
Passing a method by value |
Copy of value is sent to the method Stored in new memory location |
|
Passing a method by reference |
Address of original variable is sent to the method |
|
Creating a method that controls variables |
Variables declared within a method ceases to exist when methods ends To retain a value, return the value to the calling method - return type must match data type of value that is returned - return types can be data type |
|
Return type |
The data type of the value that the method sends back to the location where the call is made |
|
Passing a single array method |
Same manner as passing a variable or constant |
|
Passing the entire array in a method |
Use square brackets to indicate that method parameter is an array Pass by reference Changes made to the array within the method are permanent |
|
Overloading methods |
Allows for diverse meanings for a single identifier Multiple methods with the same name but different parameters list Have different signatures |
|
Overloading methods |
Allows for diverse meanings for a single identifier Multiple methods with the same name but different parameters list Have different signatures |
|
Polymorphism |
Ability of a method to act appropriately according to the context Ex: overloaded methods |
|
Overloading methods |
Allows for diverse meanings for a single identifier Multiple methods with the same name but different parameters list Have different signatures |
|
Polymorphism |
Ability of a method to act appropriately according to the context Ex: overloaded methods |
|
Ambiguous methods |
Situation in which compiler cannot determine which method to use Can occurs with an overloaded method |
|
Overloading methods |
Allows for diverse meanings for a single identifier Multiple methods with the same name but different parameters list Have different signatures |
|
Polymorphism |
Ability of a method to act appropriately according to the context Ex: overloaded methods |
|
Ambiguous methods |
Situation in which compiler cannot determine which method to use Can occurs with an overloaded method |
|
Avoid ambiguous methods |
Provide different parameter lists for methods with same name |
|
Using predefined methods |
All modern programming languages have predefined methods EX: printing message on screen, mathematical operations like square root, selecting a random number Methods already written |
|
Features of object oriented languages |
Classes - blue print Objects Polymorphism Inheritance Encapsulation |
|
Classes |
Describes objects with common attributes Object: one instance of a class Like a blue print from which many houses can be constructed |
|
Objects |
Everything is an object Every object is a member of a more general class Have predictable attributes because they are members of certain classes |
|
Inheritance |
Process of acquiring traits of one’s predecessors |
|
Encapsulation |
Process of combining an objects attributes and methods into a single package Includes data that is frequently hidden from outside classes and methods |
|
Class diagrams |
Design tool that shows an overview of class requirements consists of a rectangle divided into three parts - class name - attributes name and fasts type Method names and data types |
|
The set methods |
(Mutator Methods) Set values of data fields within a class Accepts data from outside and assigns it to a field |
|
The get methods |
(Accessor method) Returns value to world outside of class Return value can be used like any variable of its type |
|
Work Methods |
Called from another method in the same class Does not communicate with the outside world No values need to be passed in No value is returned |
|
Private access |
Data type that’s has private access cannot be used by any method that is not part of the class |
|
Public access |
Class methods that have public access can be used by other programs and methods to access private data |
|
Static methods |
Methods for which no object needs to exist Do not require THIS reference Do not receive a THIS reference as an implicit parameter Usually include the word static in the method header |
|
Non static methods |
Are instance methods |
|
Composition |
Using a class object as an attribute within another class |
|
Command line |
Input area to type system commands Requires exact syntax when typing commands Used to communicate with the computers OS |
|
GUI |
Graphic user interface Based on graphics, icons, pictures, menus Manipulates objects |
|
Event driven programming |
Caused by performing an operation on an icon Action generates a message sent to object Actions occurs in response to user-initiated events - mouse click Emphasis on objects that users manipulate Program responds to user-initiated events Users can initiate events in any order |
|
Source of event |
Component from which event generated EX: a button a user can click |
|
Listener |
Object that is “interested in” an event Waits for a response to event EX: button is a listener for a mouse click Objects must be defined as a listener and statements that constitute the event must be written |
|
Possible events |
Key press Mouse click Hover mover with mouse Right click Left click Mouse drag |
|
Possible events |
Key press Mouse click Hover mover with mouse Right click Left click Mouse drag |
|
Common GUI components |
Text box Label Check box List box Button |
|
Instantiating objects |
Occurred when using GUI components Each object belongs to a pre written class |
|
General GUI design Princibles |
Interface should be natural and predictable Interface should be attractive, easy to read, and non distracting Programs should allow some user customization Programs should be forgiving GUI should be a means to an end |
|
GUI design purpose |
Help users se available options |
|
GUI design purpose |
Help users se available options |
|
GUI Design purpose |
Help user see available options Allow ordinary use of components Not force user to concentrate on how to interact with application |
|
GUI design purpose |
Help users se available options |
|
GUI Design purpose |
Help user see available options Allow ordinary use of components Not force user to concentrate on how to interact with application |
|
Steps to developing a event driven program |
Identify objects, design classes, establish communication Plan logic Code program Translate program to machine language Test program Put program into production |
|
GUI design purpose |
Help users se available options |
|
GUI Design purpose |
Help user see available options Allow ordinary use of components Not force user to concentrate on how to interact with application |
|
Steps to developing a event driven program |
Identify objects, design classes, establish communication Plan logic Code program Translate program to machine language Test program Put program into production |
|
Story boards |
Represents picture or sketch of a screen the user will see when running a program |
|
GUI design purpose |
Help users se available options |
|
GUI Design purpose |
Help user see available options Allow ordinary use of components Not force user to concentrate on how to interact with application |
|
Steps to developing a event driven program |
Identify objects, design classes, establish communication Plan logic Code program Translate program to machine language Test program Put program into production |
|
Story boards |
Represents picture or sketch of a screen the user will see when running a program |
|
Object dictionary |
Lists objects used in a program Includes screen number in which object appears Includes whether code or script is associated with objects |
|
Interactive diagram |
Shows relationships between screens in a GUI program |
|
Interactive diagram |
Shows relationships between screens in a GUI program |
|
Container |
Components that hold all the GUI elements Class of objects Main purpose is to hold other elements |
|
Thread |
Executing flow for one set of program statements When following a single thread application executes a single program statement at a time |
|
Thread |
Executing flow for one set of program statements When following a single thread application executes a single program statement at a time |
|
Multi Threading |
All major pop languages allow multiple threads Can occurer even if computer only has one cpu Improves programs performance More user friendly: allows user multitasking Many pop languages contain built in THREAD class |
|
Deadlock |
Problem in which two or more threads waits for each to execute |
|
Starvation |
Threads is abandoned because other threads occupy all computers resources |
|
Thread synchronization |
Techniques provided in pop languages to help avoid potential problems |
|
Exceptions |
Unexpected pet error condition Occurred while program is running Unusual occurrence |
|
Exception handling |
Object-oriented technique used to manage errors Group of methods Handles predictable errors |
|
Limitations of traditional error catching |
Error conditions existed before object oriented methods Most common warrior handling solution - make a decision before using a potential error causing value Alternant dilutions and issues -prompt user for new value Client surfing traditional Error handling method must accept method’s errors-handling solution Inflexible May require multiple method versions |
|
Limitations of traditional error catching |
Error conditions existed before object oriented methods Most common warrior handling solution - make a decision before using a potential error causing value Alternant dilutions and issues -prompt user for new value Client surfing traditional Error handling method must accept method’s errors-handling solution Inflexible May require multiple method versions |
|
Try block |
Block of code you attempt to execute Can contain any number of statements or methods calls If exceptions occur, the remaining statements in TRY block do not execute |
|
Catch Block |
Code segment handling exception thrown by the try block Need at least one following a try block |
|
Multiple Catch Blocks |
Examined sequentially until found a match Matching catch block executes Remaining catch blocks bypassed |
|
Using finally block |
Used when specific actions are needed at the end of a TRY-CATCH sequence Always executes whether or not exception occurred |
|
Using finally block |
Used when specific actions are needed at the end of a TRY-CATCH sequence Always executes whether or not exception occurred |
|
Typical exceptions |
Divide by zero Accessing an element of an array that doesn’t exist Invalid entry to a text field |
|
Unreachable code |
Statement never executes under any circumstance Also known as a dead code |
|
Unhandled exceptions |
Program executes stops immediately Exception sent to operating system Current method abandoned |
|
Call stack |
Memory location Computer stores list of method memory locations Where system must return after call completed |
|
Call stack |
Memory location Computer stores list of method memory locations Where system must return after call completed |
|
Built-in exceptions |
OOP languages provide some built in exceptions types Programmer can create application specific exceptions |
|
Basic system design principles |
Break large systems into smaller subsystems - creates a better understanding As system size and complexity increase importance of good modeling techniques increases Good design models promote team communication - ensure good business solution Organizing and planning - required for developing a model for a single program or an entire business system
|
|
Basic system design principles |
Break large systems into smaller subsystems - creates a better understanding As system size and complexity increase importance of good modeling techniques increases Good design models promote team communication - ensure good business solution Organizing and planning - required for developing a model for a single program or an entire business system
|
|
Unified Modeling Language |
(UML) Popular design tool Standard way to specify, construct, and document systems that use object-oriented methods Not a programming language |
|
UML uses |
Creates top view business process diagrams Nontechnical |
|
Diagram types |
Structure diagrams Behavior diagrams |
|
Structural diagram |
Emphasizes “things”in a system - class diagram - object diagram - component diagrams - package diagrams |
|
Structural diagram |
Emphasizes “things”in a system - class diagram - object diagram - component diagrams - package diagrams |
|
Behavior diagrams |
Emphasizes what happens in a system - use case diagrams - activity diagrams - state machine diagrams |
|
Structural diagram |
Emphasizes “things”in a system - class diagram - object diagram - component diagrams - package diagrams |
|
Behavior diagrams |
Emphasizes what happens in a system - use case diagrams - activity diagrams - state machine diagrams |
|
Class diagram |
Used for a classs or set of classes - illustrates names, attributes, and methods Divide into 3 sections - top: mane of class - Middle: Name of attributes - bottom: names of methods Generalization can be used |
|
Structural diagram |
Emphasizes “things”in a system - class diagram - object diagram - component diagrams - package diagrams |
|
Behavior diagrams |
Emphasizes what happens in a system - use case diagrams - activity diagrams - state machine diagrams |
|
Class diagram |
Used for a classs or set of classes - illustrates names, attributes, and methods Divide into 3 sections - top: mane of class - Middle: Name of attributes - bottom: names of methods Generalization can be used |
|
Object Diagrams |
Model specific instances of classes Show snapshot of object at point in time |
|
Structural diagram |
Emphasizes “things”in a system - class diagram - object diagram - component diagrams - package diagrams |
|
Behavior diagrams |
Emphasizes what happens in a system - use case diagrams - activity diagrams - state machine diagrams |
|
Class diagram |
Used for a classs or set of classes - illustrates names, attributes, and methods Divide into 3 sections - top: mane of class - Middle: Name of attributes - bottom: names of methods Generalization can be used |
|
Object Diagrams |
Model specific instances of classes Show snapshot of object at point in time |
|
Component diagram |
Shows files, database tables, documents, and other components used by systems software |
|
Structural diagram |
Emphasizes “things”in a system - class diagram - object diagram - component diagrams - package diagrams |
|
Behavior diagrams |
Emphasizes what happens in a system - use case diagrams - activity diagrams - state machine diagrams |
|
Class diagram |
Used for a classs or set of classes - illustrates names, attributes, and methods Divide into 3 sections - top: mane of class - Middle: Name of attributes - bottom: names of methods Generalization can be used |
|
Object Diagrams |
Model specific instances of classes Show snapshot of object at point in time |
|
Component diagram |
Shows files, database tables, documents, and other components used by systems software |
|
Use Case Diagram |
Shows how a business works from the perspective of those who interact with the business |
|
Structural diagram |
Emphasizes “things”in a system - class diagram - object diagram - component diagrams - package diagrams |
|
Behavior diagrams |
Emphasizes what happens in a system - use case diagrams - activity diagrams - state machine diagrams |
|
Class diagram |
Used for a classs or set of classes - illustrates names, attributes, and methods Divide into 3 sections - top: mane of class - Middle: Name of attributes - bottom: names of methods Generalization can be used |
|
Object Diagrams |
Model specific instances of classes Show snapshot of object at point in time |
|
Component diagram |
Shows files, database tables, documents, and other components used by systems software |
|
Use Case Diagram |
Shows how a business works from the perspective of those who interact with the business |
|
Activity Diagram |
Shows the flow of actions in a system Used forks and joins to show simultaneous activities |