Flashcards in Mod 3 Deck (97):
Describe unstructured programming.
The most elementary method in which any line of code may be executed if logic dictates that action.
Describe procedural programming.
Groups statements that perform a specific task together.
Describe object oriented programming.
Using the concept of objects and their interactions to design applications and computer programs
What defines an object?
Classes which defines an objects attributes grouped together with behaviors. Objects do not exist until the programmer creates them.
What are the 3 common techniques Object oriented programming is based on?
What is encapsulation?
Conceals the functional details of a class from the user that the user does not "need to know".
What is inheritance?
Possesses characteristics and behaviors from the parent class while introducing it's own.
What is polymorphism?
Allows you to treat derived class members just like their parents class but achieve a different result.
What is a programming language?
How people talk to computer hardware.
What is machine code?
1st generation of programming languages. Native code to the computers CPU.
What is assembly language?
Earliest programming language and closest to machine code. 2nd generation. Composed of commands called MNEMONICS.
How does a CPU understand assembly language?
Assembly language is converted to machine code in a process called assembling, performed by an assembler tool.
What are compiled languages?
3rd generation. Not CPU specific. Requires a compiler to convert to machine code to be interpreted by CPU.
What is a compiler for C++?
What is interpreted /scripting language?
Delays the immediate assembling/compiling process and instead the code is translated each time the program is run. 3rd gen.
what is JIT (just in time) compilation?
Blurs the lines between compiler and interpreted languages. 3rd gen. The source code is compiled to an intermediate byte code the translated by a virtual machine into machine language at run-time.
What is porting?
The process of taking a program from one language or system architecture to another.
What are the three techniques used by computer programs?
What is program flow?
The process of how a program executes. Branching and looping are referred to as flow control statements.
What is a flow chart?
Graphical representation of a process that demonstrates the steps followed to arrive at a solution.
What flow chart action is represented by an oval?
Terminal. Start/end of the program.
What flow chart action is represented by a rectangle?
Process. Action to be executed.
What flow chart action is represented by a rhombus?
Input/output. Acquire data from user or display data to user.
What flow chart action is represented by a diamond?
Decision. Branch based on a Boolean decision.
What is pseudocode?
Using natural language to define code or flow charts.
What is required before any else or else if statement?
An if or else if statement.
What are two branching statements?
If and else if.
What are the 3 loop statements?
What is the different between a while and do while statement?
A while statement will check a Boolean expression before it loops and if the condition is true perform the body of the loop. The do whole tests the conditions at the bottom. Always performed at least once.
What is the concept of embedding a statement in another statement?
What are the 4 stages of compilation?
What happens in the pre-processor stage?
Combined source codes into one logic file.
what happens in the compilation phase?
The output from the pre-processor phase is converted to assembly language.
What happens in the assembly phase?
Machine code is generated from the output of the compilation phase.
What happens in the linking phase?
Takes the machine code to produce an executable.
What is an executable?
And finished program. "The thing you click on"
What are the four parts of a program?
What are comments and what are the two types?
Comments are symbols used to indicate to the compiler that the text following should be ignored. Single line comment (//) and block or multi line comment (/* */)
What is a variable?
Named memory location. Can change.
What is a constant?
A names value. Cannot change.
What are the four basic data types and their sizes?
Character 1 byte
Integer 4 bytes
Float 4 bytes
Boolean 1 byte
What are the 3 required parts of a variable declaration?
Data type, variable name, and a semicolon.
What is an array?
An array is a concept that groups data of the same type in adjacent memory locations. After declared it cannot change in size.
What are the 2 terms associated with arrays?
Index- how the computer will reference a position in an array. First position is 0.
Element- association to position in human format. Begins with 1.
What is a string?
An object that holds a series of characters. Can be any length and can change in size.
What is concatenating?
The process of joining 2 or more strings together.
What library must be utilized for input/output?
If using cin and getline in the same process what must be in between?
What is used to specify the number of decimals to include when displaying a floating number?
Must be using library.
What is a switch statement used for?
It can act as a menu.
What are the 3 essential actions in a loop?
What 2 libraries and 1 statement must be used when generating a random number?
What is a vector?
A vector is like a standard array but can increase in size.
What adds elements to a vector?
What removed the elements from the end of a vector?
What returns the current number of elements in a vector?
What are the sections of memory?
What is variable scope?
Defines how long the variable exists in memory and which parts of the program can access the variable.
What is a local variable?
Declared within a specific block of code. Stored on the program stack. Only exist while the function is running. Only accessible by the function that created them.
What is a global variable?
Declared outside of any function. Visible and modifiable by any function in the file they are declared. Exist in memory for the life of the program.
What is a static variable?
Blend of local and global scoping rules. Declared within a function and can only be accessed by that function. Exist through life of the program.
What are the 3 generally accepted programming methodologies?
What does the stack hold?
Local variables explicitly declared in a program
What is free space?
Memory set aside for stack, heap, or other uses.
What is the heap?
Dynamically allocated memory, uninitialized at first. Slower than the stack. Data can be allocated when needed and freed when it is no longer used.
What does the BSS hold?
Global and static variables which are uninitialized or initialized to 0. Exist throughout the life of the program. Also holds function pointers.
What does data hold (in memory)?
Global and static variables which are initialized to a non-zero value. Exist throughout the life of the program.
What does text hold?
Source code of the currently running program.
What is kernal mode memory?
Heart of the computer (Os, hardware etc)
What are pointers?
Special variables whose value is a memory address pointing to where the data is located in memory.
What is a * pointer?
Pointer declaration or de reference operator. Accesses data referred to by the value of the pointer variable.
What a & pointer?
Address of. Returns the address in memory where the variable is stored.
What data type are pointers?
What is another very important aspect of pointers?
Ability to bypass local scoping rules. By passing a reference to the variable using a pointer or memory address the variable can be modified by another function.
What is dynamic memory allocation?
Allows a programmer to request contiguous blocks of memory from the heap.
What is the purpose of the operator "new"?
Allocated space in memory. Returns a pointer to the allocated memory or NULL if the allocation failed.
What is the purpose of the operator "delete"?
Frees memory allocated with "new".
What is a structure?
A way of defining a complex variable type comprised of the primitive data types built into C++. Structures allow you to treat related info as one variable.
What are the parts that make up a class in a structure?
Constructor, destructor, private, public, this, getters/setters.
What is the purpose of a constructor?
Initialize the class data.
What is the purpose of a destructor?
Housekeeping when the object leaves scope or the delete keyword is used explicitly. (~)
What is the purpose of private?
Describe a section of data meant only to be used by the class itself.
What is the purpose of public?
Describe a section of info that can be accessed from outside the class.
What is the purpose of this?
Indicates the object itself and cannot be accessed outside the class.
What is the purpose of getters/setters?
Used to get and set private variables.
C++ utilizes two classes to perform file input and output which are located in the fstream header. What are they?
ifstream (input file stream)
ofstream (output file stream)
What are the 4 most common file modes?
ios::app- append to the end of the file if It already contains data otherwise treat as a new file.
ios::binary- used when a file contains data that falls outside the printable character range.
ios::in- read mode. Cannot change contents of the file. Default for ifstream.
ios::out- write mode. Truncates contents of file or creates a new file if it doesn't already exist. Default for ofstream.
What is file output?
The ability to write data to a file.
What is file input?
The ability to read data from a file.
What is a linked list?
Provides a mechanism to store data records in a logically ordered manner using pointers to other records. Not constrained by a pre-defined limit of records.
What is the head node of a linked list?
Identifies the first node of the list.
What is the tail node of a linked list?
Identifies the final node available. The next node will contain NULL to indicate there is not another node to follow.
What is the next node in a linked list?
Contains a pointer to the next node available.
What is the previous node on a linked list?
Contains a pointer to the previous node. Only used in doubly linked lists.
What is a singly linked list?
Easiest to use. Limitations are inserting or removing data in the middle of the list. Only points to the next node and must start from the first node every time granted access to another node.
What is a doubly linked list?
Has a pointer to both the previous and next node so traversal of the list can be done both forwards and backwards.