WGU D278 MIDTERM EXAM STUDY
GUIDE QUESTIONS WITH VERIFIED
ANSWERS AND DETAILED
EXPLANATIONS. 2026/2027
1. Which of the following best defines an algorithm?
A. A specific programming language like Python or Java.
B. A step-by-step procedure or formula for solving a problem.
C. The physical hardware components of a computer system.
D. A syntax error that prevents code from running.
Answer: B
Conceptual Explanation: An algorithm is a logical, step-by-step process used to solve a
problem or perform a calculation.
2. In programming, what is the primary purpose of a variable?
A. To permanently delete data from memory.
B. To serve as a comment for other developers.
C. To act as a container for storing data values.
D. To translate high-level code into machine code.
,Answer: C
Conceptual Explanation: Variables are used to store information that can be referenced
and manipulated in a program.
3. Which data type is most appropriate for storing the value 3.14?
A. Integer
B. Boolean
C. Floating-point
D. String
Answer: C
Conceptual Explanation: Floating-point (or float/double) data types are used for numbers
that contain decimal points.
4. Which of the following is a valid variable name according to most standard naming
conventions?
A. userName
B. user name
C. 2nd_user_name
D. user-name
Answer: A
, Conceptual Explanation: CamelCase (userName) is a standard naming convention;
variable names cannot start with numbers, contain spaces, or usually hyphens.
5. What does the modulo operator (%) return?
A. The quotient of a division.
B. The remainder of a division.
C. The sum of two numbers.
D. The square root of a number.
Answer: B
Conceptual Explanation: The modulo operator returns the remainder left over after
dividing one integer by another.
6. Which control structure is used to make decisions in a program?
A. A ‘for’ loop
B. A function call
C. A variable declaration
D. An ‘if’ statement
Answer: D
Conceptual Explanation: An ‘if’ statement allows the program to execute certain code
only if a specific condition is true.
GUIDE QUESTIONS WITH VERIFIED
ANSWERS AND DETAILED
EXPLANATIONS. 2026/2027
1. Which of the following best defines an algorithm?
A. A specific programming language like Python or Java.
B. A step-by-step procedure or formula for solving a problem.
C. The physical hardware components of a computer system.
D. A syntax error that prevents code from running.
Answer: B
Conceptual Explanation: An algorithm is a logical, step-by-step process used to solve a
problem or perform a calculation.
2. In programming, what is the primary purpose of a variable?
A. To permanently delete data from memory.
B. To serve as a comment for other developers.
C. To act as a container for storing data values.
D. To translate high-level code into machine code.
,Answer: C
Conceptual Explanation: Variables are used to store information that can be referenced
and manipulated in a program.
3. Which data type is most appropriate for storing the value 3.14?
A. Integer
B. Boolean
C. Floating-point
D. String
Answer: C
Conceptual Explanation: Floating-point (or float/double) data types are used for numbers
that contain decimal points.
4. Which of the following is a valid variable name according to most standard naming
conventions?
A. userName
B. user name
C. 2nd_user_name
D. user-name
Answer: A
, Conceptual Explanation: CamelCase (userName) is a standard naming convention;
variable names cannot start with numbers, contain spaces, or usually hyphens.
5. What does the modulo operator (%) return?
A. The quotient of a division.
B. The remainder of a division.
C. The sum of two numbers.
D. The square root of a number.
Answer: B
Conceptual Explanation: The modulo operator returns the remainder left over after
dividing one integer by another.
6. Which control structure is used to make decisions in a program?
A. A ‘for’ loop
B. A function call
C. A variable declaration
D. An ‘if’ statement
Answer: D
Conceptual Explanation: An ‘if’ statement allows the program to execute certain code
only if a specific condition is true.