Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4,6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 73 pages
Exam (elaborations)

WGU D278 Final Exam (Latest 2026 / 2027 Updates ) Scripting and Programming - Foundations | Questions and Verified Answers | 100% Correct | Grade A

Document preview thumbnail
Preview 4 out of 73 pages

WGU D278 Final Exam (Latest 2026 / 2027 Updates ) Scripting and Programming - Foundations | Questions and Verified Answers | 100% Correct | Grade A

Content preview

WESTERN GOVERNORS UNIVERSIT Y

Bachelor of Science in Computer Science
D278 Scripting and Programming Foundations Academic Year: 2026/2027

Final Review: Complete Question Bank (All
Terms)

Question 1

In a program, a problem's cause is called a ____, and troubleshooting is called ____.

A. bug, debugging

B. error, fixing

C. fault, repairing

D. mistake, correcting


CORRECT ANSWER: A. bug, debugging


RATIONALE: In programming, a problem's cause is called a bug, and the process of
finding and fixing bugs is called debugging.

,Question 2

Looking at each statement one-by-one to try to find a bug is called what?

A. Visual inspection

B. Debug output

C. Binary search

D. Trial and error


CORRECT ANSWER: A. Visual inspection


RATIONALE: Visual inspection is the process of looking at each statement one-by-one to
try to find a bug.



Question 3

For each statement, this process has the hypothesis: "This statement has a bug." The
test is a visual inspection of the statement. If a bug is found, is the hypothesis validated
or invalidated?

A. Hypothesis is validated

B. Hypothesis is invalidated


CORRECT ANSWER: A. Hypothesis is validated


RATIONALE:If a bug is found through visual inspection, the hypothesis that the
statement contains a bug is validated.

,Question 4

A programmer may divide the statements into regions, and insert one debug output
statement after each region. If a region's output is bad (doesn't match expected
output), the programmer can then create sub-hypotheses for the statements in that
region. What is this method called and when is it used?

A. Hierarchical debugging. Used for larger programs with 10's to 100's of statements.

B. Linear debugging. Used for small programs.

C. Binary debugging. Used for medium programs.

D. Visual debugging. Used for all programs.

CORRECT ANSWER:

A. Hierarchical debugging. Used for larger programs with 10's to 100's of statements.


RATIONALE: Hierarchical debugging is used for larger programs by dividing statements
into regions and inserting debug output statements after each region.



Question 5

Program has 12 statements. Assume each debug output statement requires 60 seconds
(some time to insert, and some to check the output). How many seconds would be
required if a debug output statement is inserted after every statement in the program?

A. 60 seconds

B. 180 seconds

C. 720 seconds


CORRECT ANSWER: C. 720 seconds


RATIONALE: 12 statements × 60 seconds = 720 seconds required.

, Question 6

Program has 12 statements. Assume each debug output statement requires 60 seconds.
How many seconds would be required if one debug statement is inserted after a first,
second, and third region of the program?

A. 60 seconds

B. 180 seconds

C. 720 seconds


CORRECT ANSWER: B. 180 seconds


RATIONALE: 3 debug statements × 60 seconds = 180 seconds required.



Question 7

Program has 12 statements. After determining that region 2 has a bug, which approach
can be used to debug region 2?

A. Visual inspection only

B. Debug output statement insertion only

C. Either visual inspection or debug output statement insertion


CORRECT ANSWER: C. Either visual inspection or debug output statement insertion


RATIONALE: Once a bad region is identified, the programmer can use either visual
inspection or insert more debug output statements to find the specific bug.

Document information

Uploaded on
July 10, 2026
Number of pages
73
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$10.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
LectMargaret
3.0
(1)
Sold
10
Followers
0
Items
358
Last sold
2 weeks ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions