General Programming Flashcards
A sequence of instructions that solves a problem is called …
an algorithm
A computer program consists of instructions executing one at a time. Basic instruction types are:
Input: A program gets data, perhaps from a file, keyboard, touchscreen, network, etc.
Process: A program performs computations on that data, such as adding two values like x + y.
Output: A program puts that data somewhere, such as to a file, screen, network, etc.
Programs use ( ) to refer to data, like x, y, and z below.
Variables. The name is due to a variable’s value varying as a program assigns a variable like x with new values.
Because a syntax error is detected by the compiler, a syntax error is known as a type of
compile-time error.
A logic error, also called a “____”, is an error that occurs while a program runs.
bug
Instructions represented as 0s and 1s are known as “_____”
machine instructions
a sequence of machine instructions together form an “_______”
executable program (sometimes just called an executable).
Because 0s and 1s are hard to comprehend, programmers soon created programs called “______” to automatically translate human readable instructions, such as “Mul 97, #9, 98”, known as “___________”, into machine instructions.
assemblers
assembly language instructions
In the 1960s and 1970s, programmers created “_________” to support programming using formulas or algorithms, so a programmer could write a formula like: F = (9 / 5) * C + 32.
high-level languages
To support high-level languages, programmers created “_______”, which are programs that automatically translate high-level language programs into executable programs.
compilers
The preprocessor reads a program before it is compiled and only executes those lines beginning with # symbol.
True
Escape sequences are always stored internally as a single character.
True
What is a Preprocessor directive and what does it start with?
Preprocessor directives are lines included in the code of programs preceded by a hash sign (#). These lines are not program statements but directives for the preprocessor. The preprocessor examines the code before actual compilation of code begins and resolves all these directives before any code is actually generated by regular statements.
In a cout statement, which of the following will advance the output position to the beginning of the next line?
endl or \n
What will the following code display?
int number = 23;
cout «_space;“The number is “ «_space;“number” «_space;endl;
The number is number