Chapter 2 Flashcards
A “data type” is a classification that describes 3 things about an item. What are those things?
- What values can be assigned to it
- How the item is stored.
- What operations can be performed on that item.
This word describes data that consists of numbers and can have arithmetic operations performed on it.
Numeric
What is a non-numeric data type called?
a “string”
What is the difference between integers and floating-point numbers?
Integers are whole numbers, while floating-point numbers make use of decimal points/places.
What is another word for floating-point numbers?
Real numbers
A numeric constant is a specific numeric value. Therefore, it is…
Literal.
A specific group of characters enclosed within quotation marks.
Literal string constant
A literal numeric or string constant is called
an unnamed constant
A feature of some programming languages that prevent assigning values of an incorrect data type
Type-safety
What would you call programming languages that prevent the assignment of an incorrect value to a data type?
Strongly-typed
The name of a program component
Identifier
the limited word set that is reserved in a programming language
keywords
What are, objectively, the ugliest naming conventions?
Hungarian notation and Kebob notation
What symbol is the assignment operator?
Equal sign.
A value used by an operator
Operand.
An operator that requires 2 operands - one on each side of it.
Binary operator.
This makes it so that a value on the right of a binary operator is saved to a memory address defined on the left of that same binary operator
Assignment statement.
In an assignment statement, what can go on the right?
A variable or constant
A more specific word for the operand on the left side of an operator that holds the memory address identifier
L-value
An unknown value stored in an unassigned variable
Garbage
Assigning a variable’s first value at the same time that said variable is declared is called:
Initializing the variable.
What makes a named constant, or “magic number” different from other variables?
Its value cannot change after its first assignment.
Dictate the order in which operations within the same statement are carried out
Rules of Precedence
Arithmetic operations use ________, while variable assignments use _________
left-to-right associativity, right-to-left associativity
Small units that, combined together, create the whole of the program
Modules
What are 4 synonyms for “modules”?
- Subroutines
- Functions
- Procedures
- Methods
Using a module’s name to invoke it, which simultaneously executes it.
“Calling a module”
The act of reducing a large program into more small-sized, manageable modules.
Functional decomposition.
The process of paying attention to important properties, while ignoring nonessential details.
Abstraction.
A feature of modular programs that allowed modules within the program to be applied in other programs.
Reusability.
The greater program that calls upon other, smaller modules.
The mainline logic.
This marks the end of the module and identifies the point at which control returns to the mainline logic or the module that called upon it.
The module’s return statement.
The act of containing a task’s instructions inside of a module
Encapsulation.
A memory location wherein the computer keeps track of the correct memory address to which it should return after executing a module.
Stack.
Measures the degree to which all of a module’s statements contribute to the same task.
Functional cohesion.
Data items that are recognizable to a module
Visible
What is visible data also called?
“In scope”
Variables that are declared only within the module that uses them.
“Local”
A _______ module is one that has a high level of reusability.
portable
Variables that are known to an entire program (mainline logic as well as all encapsulated modules) are called _________
Global variables.
Steps that are performed at the beginning of a program to prepare the program to run efficiently.
Housekeeping tasks.
Steps of a program that are repeated for each set of input data.
Detail loop tasks.
The steps you take at the end of a program to finish the application/return to the program’s mainline logic.
End-of-job tasks.
Written explanations that are not a part of the program’s logic, but that serve as documentation for those reading the program.
Program comments.
Internal documentation
Documentation within a coded program.
Programs that contain meaningful identifiers which describe their purpose
Self-documenting programs
A list of every variable name used in a program, including their type, size, and description.
Data dictionary.
Temporary variables are also called ______.
work variables.
the act of repeating input back to the user in either a subsequent prompt or in output
Echoing input.
A message displayed on a monitor that asks the user for a response (and sometimes describes how that response should be given)
Prompt.
A declaration is a statement that provides these things for a variable:
- A data type.
- An identifier
- (Optionally) an initial value.
Two separate data types:
- numeric.
2. string.
Identifiers should always be the 3 following:
- One word
- Begin with a letter
- Appropriate/meaningful
The rules of precedence can be overwritten with ________.
Parentheses
The number of chained calls among modules is only limited by…
the amount of memory available on the computer.
A rectangle with a bar across the top is the symbol for _______.
modules
These can be used for long arithmetic processes and to hold intermediate results during a program’s execution
Temporary variables.
What is the input statement called that precedes a loop?
Priming input