Studydroid is shutting down on January 1st, 2019



keywords:
Bookmark and Share



Front Back
Solve by analogy
Identify aspects of the problem that are similar to a problem in a different domain
Means-ends Analysis
Look at the input,output, and available operations and find a sequence of operations that transform the input into the output
Semantics
The set of rules that determine the meaning of instructions written in a programming language
Divide and Conquer
Break up the problem into more manageable pieces
Function
A subprogram in C++
Compiler
A program that translates a high-level language into machine code
Assembly language
A low-level programming language in which a mnemonic is used to represent each of the instructions for a particular computer
Machine Language
The language, made up of binary coded instructions, that is used directly by the computer
Programming Language
A set of rules, symbols, and special words used to construct a computer program
Algorithm
A step-by-step procedure for solving a problem in a finite amount of time
Syntax
The formal rules governing how valid instructions are written in a programming language
Source Program
A program written in a high-level programming language
Mixed type expression
A computation involving both floating-point and integer values
Binary operator
An operator with two operands
Void Function
A function that is called as a separate statement
Type casting
Explicitly changing a value of one type into another
Argument List
The values that appear between the parenthesis in a function call
Unary operator
An operator with just one operand
Type coercion
Implicitly changing a value of one type into another
initialization
int x=2;...assigning a value
declaration
int x; declaring variable name & type
function call
mechanism that transfers control to a function
value-returning functions

  • used within an expression

  • computes a value to use in expression

  • returns exactly one result

string length function
computes amount of characters in a string
string find function
searches a string to find the first occurrence of a particular substring
substring function
function that returns a particular substring of a string

  • myString.substr(starting position, length of substr)

precedence
the rules that govern the order in which C++ operators are evaluated
main function

  • Every program must have a function named main

  • Program execution begins with the first executable statement in the main function

  • The word int in the function heading means that the main function returns an integer value (to the operating system)

selection
the execution of different statements (instructions) depending on certain conditions
loop
the execution of the same statement over and over, as long as a condition or set of conditions is satisfied
if statement
fundamental control structure that allows branches in the flow of control
if-then-else
if (expression)     Statement A else     Statement B
if-then
if (expression)     Statement
nested if
skips all remaining comparisons after one alternative has been slected
logical/boolean operators
&&-AND ||-OR !-NOT
short-circuit evaluation
evaluation of a logical expression in left-to-right order with evaluation stopping as soon as the final truth value can be determined
Precedence of Operators
! Unary+ Unary-     (Highest Precedence) * / % + - < <= > => == != && || =                          (Lowest Precedence)
Testing the state of an I/O Stream
When there is Invalid input data, an attempt to read beyond the eof, an attempt to open a nonexistent file for input
Phases of Loop Execution
loop entry --> loop test --> iteration --> loop exit --> termination condition
Loop Entry
the point at which the point of control reaches the first statement inside a loop
Loop Iteration
An individual pass through, or repitition  of, the body of a loop
Loop Test
The point at which the while expression is evaluated and the decision is made either to begin a new iteration or to skip to the statement immediately following the loop
Loop Exit
The point at which the repetition of the loop body ends and control passes to the first statement following the loop
Termination condition
the condition that causes a loop to be exited
Count-controlled loop
A loop that executes a specified number of times
Event-Controlled Loop
A loop that terminates when something happens inside the loop body to signal that the loop should be exited
  • Sentinel controlled
  • End-of-file(EOF) controlled
  • Flag controlled
Sentinel Controlled Loops
Loop continues as long as the sentinel value is not read (ex. February 31)
End-of-File Controlled Loops
Loop continues as long as the input stream is not in fail state (at the end of the file -or- no more data left to be read)
Flag-Controlled Loops
uses a flag (boolean variable) to control the logical flow of a program
Switch Statement
expression whose value determines which switch label is selected. (Cannot be used with floats and strings)
x of y cards Next >|