Day 2 Flashcards
What are the three Programming methodologies?
- Unstructured
- Procedural
- Object- oriented
Describe Unstructured programs
a. Methodology is used for small, simple programs designed to run on dedicated hardware.
b. Difficult to manage once they grow in size and complexity
Describe Procedural Programs
a. Sometimes called a subprogram, subroutine, or function.
b. Source code organized by task with main block being able to call upon any procedure at any time
c. Reduces debugging by reducing amount of code.
d. When finished returns to call position
Describe Object-Oriented Programs
a. Method that uses concept of objects and their interactions to design applications.
b. Allows data to control what actions are available.
c. It’s COMPLEX
What are the two concepts that define each item in the real world?
- Attributes- characteristics of an objects
2. Behaviors- actions (methods) an object can perform
What is a class?
- Blueprint that defines the abstract details of a thing; attributes and behaviors
- REMEMBER: CAB
What are attributes and behaviors collectively?
Members of the class
Define: Object
Known as an instance of a class and does not exist until the programmer creates it.
Remember: OCM
Known as an instance of a class and does not exist until the programmer creates it. Remember: OCM
What are the 3 most common techniques of OOP?
- Encapsulation: conceals the functional details of a class
a. Includes data and functions- ensures objects integrity - Inheritance: child class inherits attributes and behaviors from an existing parent class. New class is subclass.
- Polymorphism: allows programmer to treat derived class members (child classes) just like their parents. Allows modification to achieve different result.
Define: Dot Notation
Provides a means to access the data and methods of an object.
Define: Program
series of instructions a computer follows to achieve a goal.
Define: Program Flow
Flow of execution. Process of how a program executes.
What are the 3 structural components of computer programs?
- Sequential Action Linear progression of tasks
- Branches Selection of different courses of action
- Loops Repetition structure that can potentially process the same sequence of statements multiple times.
Define: Pseudocode
Structured, natural language to abstract the technical details and programming syntax away from the reader.
Describe an IF statement:
- Evaluates a Boolean condition and executes statements only if the resulting condition is true.
- Only the first IF statement is necessary, the ELSE IF and ELSE are optional and only when logic dictates that more than one action may be necessary for a given condition.
Describe a WHILE LOOP:
- Checks a Boolean expression before it loops; if true, it executes.
- Cycle continues until Boolean condition becomes false.
Describe a FOR and FOREACH LOOP:
- Also referred to as a counting loop
* For each are another repetition structure for traversing items in a collection.
Define NESTING:
- Method of using loops within one another.
* Indentation of nested constructs clearly shows the flow of execution.
FLOWCHARTS
- Terminal - beginning or end of a program
- Process - Action to be executed
- Input/Output - Aquire data from a user or display data to a user.
- Decision - Branch based on a Boolean decision
- Predefined Process - formally defined process, function, or subroutine that is defined elsewhere
- Flowline - Direction of program flow
Stages of compilation
- Pre-processor – source code into logical file
- Compilation – logical file then goes through conversion process to generate assembly language
- Assembly – the assembly code from the previous stage runs through another conversion process to generate Object code (machine code)
- Linking – takes the object code and links together any third party libraries of pre-written code producing an executable file.