NEW WGU C173 EXAM QUESTIONS WITH
CORRECT ANSWERS
variable - ANSWER named item, such as X or numPeople that holds value
assignment statement - ANSWER the action that gives a variable a value, such
as x = 5; the statement says X is assigned with 5, X retains its value in
subsequent statements until re-assigned
variable declaration - ANSWER creation of new variable and naming and its
data type
integer - ANSWER can have values of whole numbers such as 1, 999, 0, or -25
but not 3.5 or 0.001
assignment statement - ANSWER gives the variables on the left side of the =
the current value of the right side expressions Ex: numApples = 8 gives
numApples the value of the right side expressions in this case an 8
expression ANSWER can be a number like 80 or a variable name like
numApples or an arithmetic expression like numApples + 1 Simple arithmetic
includes basic math operators such as +, -, *, as well as parentheses (like 2 *
(numApples -1)
identifier A name given by a programmer to a variable or function. An identifier
must be a letter (a-z, A-Z), followed by zero or more letters, underscores (_),
and digits (0-9). Identifiers are case sensitive.
, reserved word (or keyword) a word that is part of the programming language
itself, such as integer, Get or Put. A programmer cannot use a reserved word as
an identifier
naming conventions - ANSWER set of style guidelines defined by a company,
team, teacher, etc for naming variables.
Two common conventions for distinguishing words in an identifier are: -
ANSWER Camel case: Lower camel case abuts multiple words, capitalizing
each word except the first, as in numApples or peopleOnBus.
Underscore separated: Words are lowercase and separated by an underscore, as
in num_apples or people_on_bus.
expression - ANSWER a grouping of objects such as variables, literals,
operators and parentheses that yields a value. Ex: 2 * (x + 1) is an expression. If
x is 3, then the expression has the value 8. Expressions often occur on the right
hand side of assignment statements, such as y = 2 * (x + 1).
literal - ANSWER a specific value in code such as a 2
operator - ANSWER a symbol that performs a built-in calculation, such as the
operator + that performs addition.
An expression evaluates to a value - ANSWER replaces the expression. Ex: If x
is 5, then x + 1 evaluates to 6, and y = x + 1 assigns y with 6.
An expression is evaluated using the order of standard mathematics, such order
known in programming as precedence rules, listed below.
CORRECT ANSWERS
variable - ANSWER named item, such as X or numPeople that holds value
assignment statement - ANSWER the action that gives a variable a value, such
as x = 5; the statement says X is assigned with 5, X retains its value in
subsequent statements until re-assigned
variable declaration - ANSWER creation of new variable and naming and its
data type
integer - ANSWER can have values of whole numbers such as 1, 999, 0, or -25
but not 3.5 or 0.001
assignment statement - ANSWER gives the variables on the left side of the =
the current value of the right side expressions Ex: numApples = 8 gives
numApples the value of the right side expressions in this case an 8
expression ANSWER can be a number like 80 or a variable name like
numApples or an arithmetic expression like numApples + 1 Simple arithmetic
includes basic math operators such as +, -, *, as well as parentheses (like 2 *
(numApples -1)
identifier A name given by a programmer to a variable or function. An identifier
must be a letter (a-z, A-Z), followed by zero or more letters, underscores (_),
and digits (0-9). Identifiers are case sensitive.
, reserved word (or keyword) a word that is part of the programming language
itself, such as integer, Get or Put. A programmer cannot use a reserved word as
an identifier
naming conventions - ANSWER set of style guidelines defined by a company,
team, teacher, etc for naming variables.
Two common conventions for distinguishing words in an identifier are: -
ANSWER Camel case: Lower camel case abuts multiple words, capitalizing
each word except the first, as in numApples or peopleOnBus.
Underscore separated: Words are lowercase and separated by an underscore, as
in num_apples or people_on_bus.
expression - ANSWER a grouping of objects such as variables, literals,
operators and parentheses that yields a value. Ex: 2 * (x + 1) is an expression. If
x is 3, then the expression has the value 8. Expressions often occur on the right
hand side of assignment statements, such as y = 2 * (x + 1).
literal - ANSWER a specific value in code such as a 2
operator - ANSWER a symbol that performs a built-in calculation, such as the
operator + that performs addition.
An expression evaluates to a value - ANSWER replaces the expression. Ex: If x
is 5, then x + 1 evaluates to 6, and y = x + 1 assigns y with 6.
An expression is evaluated using the order of standard mathematics, such order
known in programming as precedence rules, listed below.