WGU C173 NEW EXAM QUESTIONS WITH
DETAILED VERIFIED ANSWERS
variable
named item such as X or numPeople which is used to hold value
assignment statement
assigns a variable with a value such as x = 5, statement means X is assigned with 5 and X keeps
the value during subsequent statements until X is assigned again
variable declaration
declares a new variable specifying the variable's name and type
integer
can hold whole number values like 1, 999, 0, or -25 but not 3.5 or 0.001
assignment statement
assigns the variables on the left side of the = with the current value of the right side expressions
Ex: numApples = 8 assigns numApples with the value of the right side expressions in this case
an 8
expression
may be a number like 80, a variable name like numApples, or a simple calculation like
numApples + 1, simple calculations can involve standard math operations like +, -, , and
parentheses as in 2(numApples -1)
identifier
A name created by a programmer for an item like a variable or function, an identified must be a
sequence of letters (a-z, A-Z), underscores (_), and digits (0-9), they are case sensitive
reserved word (or keyword)
, word that is part of the language like integer, Get, or Put, programmer cannot use reserved word
as a identifier
naming conventions
set of style guidelines defined by a company, team, teacher, etc., for naming variables.
Two common conventions for distinguishing words in an identifier are:
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
a combination of items, like variables, literals, operators, and parentheses, that evaluates to a
value. Ex: 2 (x + 1) is an expression. If x is 3, the expression evaluates to the value 8.
Expressions are commonly used on the right side of an assignment statement, as in y = 2 (x
+ 1).
literal
a specific value in code like a 2
operator
a symbol that performs a built-in calculation, like the operator + which performs addition.
An expression evaluates to a value
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.
unary minus
DETAILED VERIFIED ANSWERS
variable
named item such as X or numPeople which is used to hold value
assignment statement
assigns a variable with a value such as x = 5, statement means X is assigned with 5 and X keeps
the value during subsequent statements until X is assigned again
variable declaration
declares a new variable specifying the variable's name and type
integer
can hold whole number values like 1, 999, 0, or -25 but not 3.5 or 0.001
assignment statement
assigns the variables on the left side of the = with the current value of the right side expressions
Ex: numApples = 8 assigns numApples with the value of the right side expressions in this case
an 8
expression
may be a number like 80, a variable name like numApples, or a simple calculation like
numApples + 1, simple calculations can involve standard math operations like +, -, , and
parentheses as in 2(numApples -1)
identifier
A name created by a programmer for an item like a variable or function, an identified must be a
sequence of letters (a-z, A-Z), underscores (_), and digits (0-9), they are case sensitive
reserved word (or keyword)
, word that is part of the language like integer, Get, or Put, programmer cannot use reserved word
as a identifier
naming conventions
set of style guidelines defined by a company, team, teacher, etc., for naming variables.
Two common conventions for distinguishing words in an identifier are:
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
a combination of items, like variables, literals, operators, and parentheses, that evaluates to a
value. Ex: 2 (x + 1) is an expression. If x is 3, the expression evaluates to the value 8.
Expressions are commonly used on the right side of an assignment statement, as in y = 2 (x
+ 1).
literal
a specific value in code like a 2
operator
a symbol that performs a built-in calculation, like the operator + which performs addition.
An expression evaluates to a value
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.
unary minus