Scripting & Programming PA | Questions,
Answers & Detailed Rationales 2026
RESOURCE FEATURES
➢ WGU D278 Final Exam 2026 study guide
➢ Scripting & Programming Foundations practice questions
➢ Questions and answers
➢ Detailed explanations and rationales
,WGU D278 Scripting & Programming PA
| Questions, Answers & Detailed
Rationales 2026
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) Division
D) Multiplication
Answer: C) Division
Rationale: Miles per gallon is calculated by dividing the total miles
driven by the total gallons of fuel used. 200 miles ÷ 10 gallons = 20
miles per gallon.
Question 2
,Which operator should be used to determine if a number is evenly
divisible by 5?
A) /
B) %
C) *
D) //
Answer: B) %
Rationale: The modulo operator (%) returns the remainder of a
division. If a number % 5 equals 0, the number is evenly divisible by 5.
Question 3
A variable should hold a person's height in meters. Which data type
should the variable be?
A) Integer
B) String
C) Float
D) Boolean
Answer: C) Float
, Rationale: Height in meters can include decimal values (e.g., 1.75
meters), so a floating-point data type is appropriate.
Question 4
A variable should hold the names of all past U.S. presidents. Which data
type should the variable be?
A) String
B) String array
C) Integer array
D) Float
Answer: B) String array
Rationale: Multiple names need to be stored, and each name is a
string. A string array allows storage of multiple string values.
Question 5
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?