D615 WGU Foundations of Coding Pre-assessment
Actual Questions and CORRECT 100%
DETAILED ANSRs | 100% Correct |
Instant Pdf Download
Introduction:
This practice pre-assessment is designed to help students master coding
fundamentals, logic, loops, functions, arrays, recursion, and
algorithms as covered in WGU D615. Questions simulate the style and
difficulty of the official assessment, providing CORRECT 100%
DETAILED ANSRs in bold with clear rationales for self-study and
preparation.
Q1.
What is the main purpose of a variable in a program?
A. To execute instructions
B. To store data values for later use
C. To define program logic
D. To control program flow
CORRECT 100% DETAILED ANSR: B
Rationale:
A variable is used to store data in memory so it can be accessed or
modified during program execution.
Q2.
Which of the following best describes an algorithm?
A. A programming language
,B. A step-by-step solution to a problem
C. A block of executable code
D. A debugging tool
CORRECT 100% DETAILED ANSR: B
Rationale:
An algorithm is a logical sequence of steps designed to solve a specific
problem, regardless of programming language.
Q3.
Which data type would be most appropriate for storing a user’s age?
A. String
B. Boolean
C. Integer
D. Float
CORRECT
100%
DETAILED
ANSR: C
Rationale:
Age is typically a whole number, making an integer the most
appropriate data type.
Q4.
What is the result of the expression:
, (in most programming languages)?
A. 3
B. 3.33
C. 3.0
D. Error
CORRECT 100% DETAILED ANSR: B
Rationale:
Division usually returns a decimal (floating-point) value unless integer
division is explicitly specified.
Q5.
Which operator is used to compare two values for equality?
A. =
B. !=
C. == D. <= CORRECT 100% DETAILED ANSR: C
Rationale:
== is used for comparison, while = is used for assignment.
Q6.
Which of the following is an example of a Boolean value?
A. "True"
B. 1
C. TRUE
D. true CORRECT 100% DETAILED ANSR: D
Rationale:
, Boolean values are typically true or false, not strings or numeric
representations.
Q7.
What does the following pseudocode represent?
IF score >= 60
DISPLAY "Pass" ELSE
DISPLAY "Fail"
A. Loop structure
B. Function definition
C. Conditional statement
D. Variable assignment
CORRECT 100% DETAILED ANSR: C
Rationale:
The IF–ELSE structure is a conditional, used to make decisions based
on conditions.
Q8.
Which symbol is commonly used for logical AND?
A. ||
B. &
C. &&
D. AND CORRECT 100% DETAILED ANSR: C
Rationale:
&& represents logical AND, meaning both conditions must be true.
Actual Questions and CORRECT 100%
DETAILED ANSRs | 100% Correct |
Instant Pdf Download
Introduction:
This practice pre-assessment is designed to help students master coding
fundamentals, logic, loops, functions, arrays, recursion, and
algorithms as covered in WGU D615. Questions simulate the style and
difficulty of the official assessment, providing CORRECT 100%
DETAILED ANSRs in bold with clear rationales for self-study and
preparation.
Q1.
What is the main purpose of a variable in a program?
A. To execute instructions
B. To store data values for later use
C. To define program logic
D. To control program flow
CORRECT 100% DETAILED ANSR: B
Rationale:
A variable is used to store data in memory so it can be accessed or
modified during program execution.
Q2.
Which of the following best describes an algorithm?
A. A programming language
,B. A step-by-step solution to a problem
C. A block of executable code
D. A debugging tool
CORRECT 100% DETAILED ANSR: B
Rationale:
An algorithm is a logical sequence of steps designed to solve a specific
problem, regardless of programming language.
Q3.
Which data type would be most appropriate for storing a user’s age?
A. String
B. Boolean
C. Integer
D. Float
CORRECT
100%
DETAILED
ANSR: C
Rationale:
Age is typically a whole number, making an integer the most
appropriate data type.
Q4.
What is the result of the expression:
, (in most programming languages)?
A. 3
B. 3.33
C. 3.0
D. Error
CORRECT 100% DETAILED ANSR: B
Rationale:
Division usually returns a decimal (floating-point) value unless integer
division is explicitly specified.
Q5.
Which operator is used to compare two values for equality?
A. =
B. !=
C. == D. <= CORRECT 100% DETAILED ANSR: C
Rationale:
== is used for comparison, while = is used for assignment.
Q6.
Which of the following is an example of a Boolean value?
A. "True"
B. 1
C. TRUE
D. true CORRECT 100% DETAILED ANSR: D
Rationale:
, Boolean values are typically true or false, not strings or numeric
representations.
Q7.
What does the following pseudocode represent?
IF score >= 60
DISPLAY "Pass" ELSE
DISPLAY "Fail"
A. Loop structure
B. Function definition
C. Conditional statement
D. Variable assignment
CORRECT 100% DETAILED ANSR: C
Rationale:
The IF–ELSE structure is a conditional, used to make decisions based
on conditions.
Q8.
Which symbol is commonly used for logical AND?
A. ||
B. &
C. &&
D. AND CORRECT 100% DETAILED ANSR: C
Rationale:
&& represents logical AND, meaning both conditions must be true.