WGU D278 OA | Objective Assessment |
163 Questions and Answers | 2026 Update
| 100% Correct.
WGU D278 OA | Objective Assessment | 163 Questions and Answers
Latest 2025/2026 Update | 100% Correct
Section 1: Basic Programming Concepts and Terminology
Question 1
What is the primary purpose of a variable in programming?
A. To perform mathematical calculations
B. To store data that can be used and changed throughout a program
C. To define a function
D. To create a user interface
Correct Answer: B. To store data that can be used and changed throughout a
program
Rationale: A variable is a named memory location that stores data which can
change during program execution, allowing for dynamic computations .
Question 2
Which operator is used for assignment in most programming languages?
A. ==
B. ===
C. =
D. :=
Correct Answer: C. =
,Rationale: The single equals sign = is the assignment operator, used to assign a
value to a variable (e.g., x = 5). The double equals == is the equality operator .
Question 3
What is a literal in programming?
A. A name created by a programmer for an item like a variable or function
B. A fixed value written directly in the code
C. A symbol that performs a built-in calculation
D. A word that is part of the language and cannot be used as an identifier
Correct Answer: B. A fixed value written directly in the code
Rationale: A literal is a specific, fixed value in code, such as 42, "hello", or 3.14 .
Question 4
An identifier in programming must:
A. Start with a digit
B. Contain only uppercase letters
C. Start with a letter or underscore, followed by letters, digits, or underscores
D. Be a reserved word
Correct Answer: C. Start with a letter or underscore, followed by letters, digits,
or underscores
Rationale: Identifiers are names created by programmers for variables, functions,
etc. They must begin with a letter or underscore and cannot be reserved words .
Question 5
Which of the following is a reserved word (keyword) in most programming
languages?
A. variable1
B. myFunction
,C. while
D. user_name
Correct Answer: C. while
Rationale: Reserved words or keywords are part of the language itself and cannot
be used as identifiers. Examples include if, while, for, int, etc .
Question 6
What is an expression in programming?
A. A combination of items that evaluates to a value
B. A statement that assigns a value
C. A loop that repeats code
D. A function that returns no value
Correct Answer: A. A combination of items that evaluates to a value
Rationale: An expression combines variables, literals, operators, and parentheses
to produce a single value. Example: 2 * (x + 1) .
Question 7
Which naming convention capitalizes each word except the first, such
as numApples?
A. Upper camel case
B. Lower camel case
C. Underscore separated
D. Pascal case
Correct Answer: B. Lower camel case
Rationale: Lower camel case starts with a lowercase letter and capitalizes each
subsequent word (e.g., myVariableName). Upper camel case (Pascal case)
capitalizes the first letter as well .
, Question 8
The process of writing, compiling, and testing a small amount of code, then
repeating is called:
A. Waterfall development
B. Agile development
C. Incremental development
D. Modular development
Correct Answer: C. Incremental development
Rationale: Incremental development involves writing, compiling, and testing
small amounts of code in succession, building the program gradually .
Question 9
Which data type would be most appropriate for storing a person's age?
A. Float
B. String
C. Integer
D. Boolean
Correct Answer: C. Integer
Rationale: Age is typically a whole number, so an integer data type is most
appropriate. Floats are for decimal values, strings for text, and booleans for
true/false .
Question 10
Which data type should be used for items that are measured in length?
A. Integer
B. Float
C. String
D. Boolean
Correct Answer: B. Float
163 Questions and Answers | 2026 Update
| 100% Correct.
WGU D278 OA | Objective Assessment | 163 Questions and Answers
Latest 2025/2026 Update | 100% Correct
Section 1: Basic Programming Concepts and Terminology
Question 1
What is the primary purpose of a variable in programming?
A. To perform mathematical calculations
B. To store data that can be used and changed throughout a program
C. To define a function
D. To create a user interface
Correct Answer: B. To store data that can be used and changed throughout a
program
Rationale: A variable is a named memory location that stores data which can
change during program execution, allowing for dynamic computations .
Question 2
Which operator is used for assignment in most programming languages?
A. ==
B. ===
C. =
D. :=
Correct Answer: C. =
,Rationale: The single equals sign = is the assignment operator, used to assign a
value to a variable (e.g., x = 5). The double equals == is the equality operator .
Question 3
What is a literal in programming?
A. A name created by a programmer for an item like a variable or function
B. A fixed value written directly in the code
C. A symbol that performs a built-in calculation
D. A word that is part of the language and cannot be used as an identifier
Correct Answer: B. A fixed value written directly in the code
Rationale: A literal is a specific, fixed value in code, such as 42, "hello", or 3.14 .
Question 4
An identifier in programming must:
A. Start with a digit
B. Contain only uppercase letters
C. Start with a letter or underscore, followed by letters, digits, or underscores
D. Be a reserved word
Correct Answer: C. Start with a letter or underscore, followed by letters, digits,
or underscores
Rationale: Identifiers are names created by programmers for variables, functions,
etc. They must begin with a letter or underscore and cannot be reserved words .
Question 5
Which of the following is a reserved word (keyword) in most programming
languages?
A. variable1
B. myFunction
,C. while
D. user_name
Correct Answer: C. while
Rationale: Reserved words or keywords are part of the language itself and cannot
be used as identifiers. Examples include if, while, for, int, etc .
Question 6
What is an expression in programming?
A. A combination of items that evaluates to a value
B. A statement that assigns a value
C. A loop that repeats code
D. A function that returns no value
Correct Answer: A. A combination of items that evaluates to a value
Rationale: An expression combines variables, literals, operators, and parentheses
to produce a single value. Example: 2 * (x + 1) .
Question 7
Which naming convention capitalizes each word except the first, such
as numApples?
A. Upper camel case
B. Lower camel case
C. Underscore separated
D. Pascal case
Correct Answer: B. Lower camel case
Rationale: Lower camel case starts with a lowercase letter and capitalizes each
subsequent word (e.g., myVariableName). Upper camel case (Pascal case)
capitalizes the first letter as well .
, Question 8
The process of writing, compiling, and testing a small amount of code, then
repeating is called:
A. Waterfall development
B. Agile development
C. Incremental development
D. Modular development
Correct Answer: C. Incremental development
Rationale: Incremental development involves writing, compiling, and testing
small amounts of code in succession, building the program gradually .
Question 9
Which data type would be most appropriate for storing a person's age?
A. Float
B. String
C. Integer
D. Boolean
Correct Answer: C. Integer
Rationale: Age is typically a whole number, so an integer data type is most
appropriate. Floats are for decimal values, strings for text, and booleans for
true/false .
Question 10
Which data type should be used for items that are measured in length?
A. Integer
B. Float
C. String
D. Boolean
Correct Answer: B. Float