Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

WGU Scripting and Programming Foundations (D278) Exam - Topic 4 Question 14 Discussion

Posted by Carolynn on Jun 27, 2026 at 12:45 AM

Which expression evaluates to 4 if integer y = 3?

Suggested Answer: D

Comprehensive and Detailed Explanation From Exact Extract:

Given y = 3 (an integer), we need to evaluate each expression to find which yields 4. According to foundational programming principles, operator precedence and type handling (e.g., integer vs. floating-point division) must be considered.

Option A: '0 - y / 5.0.'

Compute: y / 5.0 = 3 / 5.0 = 0.6 (floating-point division due to 5.0).

Then: 0 - 0.6 = -0.6.

Result: -0.6 4. Incorrect.

Option B: '(1 + y) * 5.'

Compute: 1 + y = 1 + 3 = 4.

Then: 4 * 5 = 20.

Result: 20 4. Incorrect.

Option C: '11.0 - y / 5.'

Compute: y / 5 = 3 / 5 = 0 (integer division, as both are integers).

Then: 11.0 - 0 = 11.0.

Result: 11.0 4. Incorrect.

Option D: '11 + y % 5.'

Compute: y % 5 = 3 % 5 = 3 (remainder of 3 5).

Then: 11 + 3 = 14.

Result: 14 4.

Correction Note: None of the options directly evaluate to 4 with y = 3. However, based on standard problem patterns, option D's expression 11 + y % 5 is closest to typical correct answers in similar contexts, but the expected result should be re-evaluated. Assuming a typo in the options or expected result, let's test a likely correct expression:

If the expression were 1 + y % 5:

y % 5 = 3, then 1 + 3 = 4.

This fits, but it's not listed. Since D is the most plausible based on structure, we select it, noting a potential error in the problem.

Answer (Tentative): D (with note that the problem may contain an error, as no option yields exactly 4).

Certiport Scripting and Programming Foundations Study Guide (Section on Operators and Expressions).

Python Documentation: ''Arithmetic Operators'' (https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations).

W3Schools: ''C Operators'' (https://www.w3schools.com/c/c_operators.php).


Get Premium Scripting and Programming Foundations (D278) Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
21 comments · newest first
RO
Romana 2 days ago
What about C? 11.0 - 3 / 5 = 10.4.
JU
Julio 7 days ago
A is definitely not it. We need 4.
KR
Kristin 12 days ago
A looks interesting. 0 - 3 / 5.0 = -0.6.
TH
Thea 17 days ago
D is also not correct. It gives 14, not 4.
JI
Jimmie 23 days ago
I feel like D could be the right choice. 11 + 3 % 5 = 14.
LO
Louvenia 28 days ago
No, B is wrong. It evaluates to 20, not 4.
GE
Geraldine 1 month ago
I think B is the answer. (1 + 3) * 5 = 20.
AI
Aimee 1 month ago
Totally agree, B is the only one that makes sense!
DE
Dean 1 month ago
Wait, how does C) work? I’m confused.
JE
Jerry 2 months ago
D) is definitely not 4, it’s 11.
AB
Abel 2 months ago
I think A) is wrong, it gives a negative value.
BO
Bobbye 2 months ago
B) (1 + y) * 5 evaluates to 4.
AN
Antonio 2 months ago
B) is the only one that works, for sure!
LE
Leota 2 months ago
Wait, are we sure about C)? That seems off.
LE
Lenna 2 months ago
D) is definitely not 4, it’s 11.
KE
Kelvin 3 months ago
I think A) is wrong, it gives 0.
LA
Laila 3 months ago
B) (1 + y) * 5 evaluates to 4.
LA
Laurel 3 months ago
I think option A is definitely not it since 0 - 3 / 5.0 would give a negative number, right?
CH
Chantay 3 months ago
I practiced a similar question where we had to evaluate expressions with variables. I feel like option D could be close since y % 5 is 3, but I’m not confident.
RI
Rikki 3 months ago
I'm not sure about option C; I remember something about dividing by 5 but can't recall if it would give 4.
DE
Devora 4 months ago
I think option B might be the right choice because (1 + 3) * 5 equals 20, but I need to double-check the calculations.
0/2000 characters

Save Cancel