What type of error occurs when you write code that does not properly meet the "grammar" or rules of the programming language?
A syntax error
In a flowchart, a _____ symbol or shape is used to represent "processing"
A rectangle.
(Also accept square, which, technically, is a specific type of rectangle.)
On a flowchart, a diamond shape represents a
Decision or selection
In the code below, which variable is the loop control variable?
for( int i = 0; i < 10; i++){
if( array[i] > x) {
total = total + array[i];
}
}
"i"
In the code below, what variable is known as the "subscript"
myValue = someArray[x];
What type of error occurs when you write code that meets all the "grammar" or rules of the programming language but does not do what you intended for it to do?
A logical error or a "bug"
The repetition of a series of steps.
What is a loop
These types of errors are often easier to locate and correct because the compiler will report these errors as you are editing in an IDE or when you try to compile the program
Syntax error
It is common for loop control variables to either be ____ or ____ by one with each iteration of a loop
Incremented, decremented
When discussing the logical design of a program, we often refer to a section of code as a "module". What is another term that is synonymous with the term "module" in modern programming languages.
A "method" or "function"
A named memory location whose value can vary.
A variable
The _____ is the standard symbol or shape for both the start and end of a program or module.
Oval or lozenge shape.
This feature of a programming language prevents a programmer from trying to store incompatible data in a variable
Type safety or data type checking
What is the purpose of a compiler?
The compiler checks the syntax of the program code and translates the program code (aka source code) into machine code.
In other words, the compiler translates the programming code written by a person into code that is understood by the computer hardware.
Describe what the object oriented programming term "encapsulation" means
Encapsulation means to bundle or contain related data and methods together in a single unit (i.e. a class) to allow control and restrict access to the encapsulated data / methods.
Essentially, to enforce structure by hiding or protecting data elements within a class or module.
A named memory location whose value can not vary after it is initialized?
A CONSTANT.
On a flowchart, this shape is used to represent input or output
A paralellogram
This data type can store a sequence of printable letters, numbers or punctuation marks.
A string
When a subscript of an array is not within the range of acceptable subscripts it is said to be
out-of-bounds or out of range.
This type of programming model forces the programmer to design and structure their program around real word or logical concepts or components.
Object oriented programming
___ is a software package or system that provides an editor, compiler and other programming tools.
An Integrated Development Environment (IDE).
Visual Studio is an IDE.
Before a programmer plans the logic of a program, they must
Understand the goal for the program or understand the problem they are trying to solve.
In short, you need to know "what to do" before you try to start doing it.
A repeating flow of logic or a repeating sequence in a program that does not have a condition that will allow it to end on it's own.
An infinite loop.
What is the purpose of object oriented programming?
The purpose of object oriented programming is to force programmers to design programs in a more structured, modular and logical way.
Assume the following code is written in C++.
After how many iterations will the following loop end?
x = 0;
while( x = 4 ){
x = x + 1;
}
The loop will never end on it's own. It is an infinite loop because the equality operator is the double equals "==". The assignment operator is "=".