2. Variables / Assignments Flashcards
A(n) ____ is a named item, such as x or numPeople, used to hold a value.
variable
A(n) ____ assigns a variable with a value, such as x = 5.
assignment statement
The equals sign (=) is known as a(n) ____ operator. It is NOT equality as in mathematics.
assignment
A variable declaration declares a new variable, specifying the variable’s ____ and ____.
name, type
A variable of type ____ can hold whole number values, like 1, 999, 0, or -25 (but not 3.5 or 0.001).
integer
A name created by a programmer for an item like a variable or function is called a(n) ____.
identifier
A ____ word (or ____) is a word that is part of the language, like integer, Get, or Put. A programmer cannot use one of these words as an identifier.
reserved, keyword
Identifiers must start with a(n) ____.
letter
Identifiers must be a sequence of ____, ___, and ____.
letters, underscores, digits
A(n) ____ is a combination of items, like variables, literals, operators, and parentheses, that evaluates to a value.
expression
A(n) ____ is a specific value in code, like 2.
literal
A(n) ____ is a symbol that performs a built-in calculation, like “+”.
operator
An expression is evaluated using the order of standard mathematics, such order known in programming as ____.
precedence rules
List the precedence rules for arithmetic operators. Start with the operator that is evaluated first.
- ()
- unary - (“unary minus,” used for negation)
- /
- -
- left-to-right
____ development is the process of writing, compiling, and testing a small amount of code, then writing, compiling, and testing a small amount more, and so on.
Incremental
A(n) ____ is a real number, like 98.6, 0.0001, or -666.667.
floating point number
A floating point ____ is a number with a fractional part, even if that fraction is 0, as in 1.0, 0.0, or 99.573.
literal
Integer variables are typically used for values that are ____, whereas floating-point variables are typically used for values that are ____.
counted, measured
If the dividend and divisor in floating-point division are both 0, the division results in a ____.
NotANumber
A(n) ____ is a list of statements executed by invoking this thing’s name, with such invoking known as a ____ call.
function
Function input values are called ____.
arguments
For the first call to the RandomNumber() function, no previous random integer exists, so the function uses a built-in integer known as the ____.
seed
A programmer can specify the seed for a random number using the function ____.
SeedRandomNumbers()
When the operands of “/” are both integers, what data type is the quotient?
An integer