Foundations Pre-Assessment Exam –
Complete 270 Questions with Verified
Answers
Official Exam Overview:
The WGU D278 Pre-Assessment Exam evaluates learners’ understanding of programming
fundamentals, including arithmetic operations, data types, variables, constants, and problem-
solving using code. The exam emphasizes proper use of operations, program logic, and
calculation techniques.
Exam Coverage Areas:
• Arithmetic Operations and Expressions
• Variables and Constants
• Control Structures and Loops
• Functions and Procedures
• Input/Output Handling
• Program Logic and Debugging
• Problem-Solving in Programming
• Multiple Choice and Short Answer Question Formats
QUESTION 1: A car drove 200 miles using 10 gallons of fuel. Which operation should be used
to compute the miles per gallon, which is 20?
a) Addition
b) Subtraction
c) Multiplication
d) Division ✅
Rationale: Division is used to compute miles per gallon by dividing the distance traveled (200
miles) by the fuel used (10 gallons), resulting in 20 mpg.
QUESTION 2: If a program multiplies two numbers, which arithmetic operation is being used?
a) Addition
b) Multiplication ✅
c) Division
d) Modulus
Rationale: Multiplication combines two numbers to calculate a product, used in scaling or
repeated addition scenarios.
QUESTION 3: To find the remainder when dividing 17 by 5, which operation is appropriate?
a) Division
b) Modulus ✅
,c) Subtraction
d) Exponentiation
Rationale: The modulus operation returns the remainder of a division, useful in programming
for loops and conditional checks.
QUESTION 4: When calculating total cost as quantity × price, which operation is applied?
a) Multiplication ✅
b) Addition
c) Division
d) Subtraction
Rationale: Multiplication calculates total cost by scaling the price by the number of items
purchased.
QUESTION 5: Which arithmetic operation should be used to calculate the average of five
numbers?
a) Sum all numbers and divide by five ✅
b) Subtract the smallest from the largest
c) Multiply all numbers together
d) Use modulus to find remainder
Rationale: The average is calculated by adding all numbers together and then dividing by the
count, which involves addition and division operations.
Page 1 of 53
Q: A car drove 200 miles using 10 gallons of fuel. Which operation should be used to compute
the miles per gallon, which is 20? - ANSWER-Division
Q: Which operator should be used to determine if a number is evenly divisible by 5? - ANSWER-
%
Q: A variable should hold a person's height in meters. Which data type should the variable be? -
ANSWER-Float
,Q: A variable should hold the names of all past U.S. presidents. Which data type should the
variable be? - ANSWER-String array
Q: A program uses the number of seconds in a minute in various calculations. How should the
item that holds the number of seconds in a minute be declared? - ANSWER-Constant integer
secondsPerMinute
1
, Page 2 of 53
Q: A program determines if a user's age is high enough to run for U.S. president. The minimum
age requirement is 35. How should the item that holds the minimum age be declared? -
ANSWER-Constant integer minAge
Q: Given integer x = 3 and integer y = 5.What is the value of the expression (x / 2.0) + y? -
ANSWER-6.5
Q: Given float x = 10.2 and float y = 1.0.What is the value of the expression x / y? - ANSWER-
10.2
Q: What kind of operator is the == in the expression i == 20? - ANSWER-Equality
Q: What is the purpose of parentheses () in a programming expression? - ANSWER-To group
expressions
Q: Given float x = 3.0.Which expression evaluates to 2.0? - ANSWER-x / 2 + 0.5 /2 + .25
Q: Which expression represents all the values of x, when x is the age ranging from 18 to 24
years old? - ANSWER-(x >= 18) and (x <= 24)
2