Limited-Time Offer: Enjoy 50% Savings! - Ends In 0d 13h 21m 44s Coupon code: 50OFF

WGU Scripting-and-Programming-Foundations Exam Questions & Answers (November 2026)

WGU Scripting and Programming Foundations exam questions with 10 free practice questions and explained answers. Updated November 26, 2026. ยท See all WGU exams

Answer 10 scenario questions on this page and see your score as you go. No sign-up needed.

Exam Details

Exam Code
Scripting-and-Programming-Foundations
Vendor
WGU
Question Types
Single Choice
Official Page
View Exam Page
1

Identifying Scripts for Computer Program Requirements

This topic covers choosing a script or coding approach that fits defined workplace requirements. Candidates must consider the operating environment, available tools, and limits on deployment when selecting an approach.

Question 1 of 10 Single Choice

A nonprofit needs a nightly report that combines CSV exports from two internal systems and writes totals to a new file. The task runs on both Linux and macOS machines, and staff must maintain one script for both platforms. The machines have no database service, and policy prohibits installing third-party packages. Which scripting language best meets the team's requirements?

Which scripting language best meets the team's requirements?

Show Answer

Correct Answer

C

Option C, Python, is correct because its standard library parses CSV and supports the same scheduled script on Linux and macOS without added packages. Option A is not correct because Bash behavior and available utilities can differ between those systems. Option B is not correct because browser-based JavaScript does not fit scheduled local file processing. Option D is not correct because SQL needs a database, which the team does not use.

Question 2 of 10 Single Choice

An administrator must create a weekly report of stopped services and selected Windows event log entries on 40 company workstations. The script will run through Windows Task Scheduler, and the security team does not permit installing a separate language runtime. The administrator also needs to use existing Windows management features and save a CSV report locally. Which scripting language should the administrator use?

Which scripting language should the administrator use?

Show Answer

Correct Answer

B

Option B, PowerShell, is correct because the Windows environment provides access to event logs, services, and scheduled-task administration without installing another runtime. Option A is not correct because Python would require a separate runtime and suitable Windows libraries under the stated restriction. Option C is not correct because Bash is not the approved native management interface on these workstations. Option D is not correct because SQL cannot administer the local Windows services or event logs.

Question 3 of 10 Single Choice

A department maintains a static web page with a request form that employees use in current desktop browsers. Users often submit incomplete entries, but the department can edit only the page files and cannot change the web server or install software on employee devices. The server must still perform its existing checks after submission. Which scripting language best fits the requirement to alert users about missing fields before they submit?

Which scripting language best fits this requirement?

Show Answer

Correct Answer

A

Option A, JavaScript, is correct because it runs in the users' browsers and can check fields before the existing form is submitted, without a server change. Option B is not correct because Python would need a server-side runtime, which the team cannot add. Option C is not correct because SQL queries data stores rather than validating a browser form. Option D is not correct because PowerShell is not a browser scripting environment.

2

Explaining Logic and Outcomes of Simple Algorithms

This topic covers how simple algorithms process inputs through ordered steps and conditions. Candidates must be able to trace those steps, apply each rule correctly, and determine the resulting value.

Question 4 of 10 Single Choice

A small warehouse uses a short algorithm to calculate a handling score from three package values. The worker must verify the score before entering it into a daily report. The values are processed in the listed order, and the final operation occurs only after every value has been handled. The algorithm is as follows. Set total to 4 For each value in [3, 2, 5] If value > 2 Set total to total + value Else Set total to total - 1 After the loop, set total to total * 2

What value does the algorithm produce for total?

Show Answer

Correct Answer

B

Option B is correct because total changes from 4 to 7, then 6, then 11, and the final multiplication produces 22. Option A is not correct because it omits the final multiplication. Option C is not correct because the value 2 follows the else branch. Option D is not correct because it treats 2 as greater than 2.

Question 5 of 10 Single Choice

A delivery team checks a simple weight score before approving a collection. Each package is processed in order, and heavier packages receive a reduction before their adjusted weight is added. A final rule lowers the score only when the accumulated value exceeds 15. The algorithm is as follows. Set total to 0 For each weight in [6, 4, 9] If weight >= 6 Set total to total + weight - 2 Else Set total to total + weight If total > 15 Set total to total - 3

What value does the algorithm produce for total?

Show Answer

Correct Answer

B

Option B is correct because the three additions produce 4, 4, and 7, giving a total of 15, which is not greater than 15. Option A is not correct because it applies the subtraction at a greater-than-or-equal threshold. Option C is not correct because it ignores the reductions for qualifying weights. Option D is not correct because it subtracts 2 instead of 3.

Question 6 of 10 Single Choice

A facilities worker reviews four equipment readings and uses a running change score to decide whether the readings have been stable. The algorithm compares each reading with the immediately preceding reading, rather than with the initial reading. It updates the reference after each comparison. The readings and algorithm are shown below. Set previous to 5 Set changes to 0 For each reading in [4, 7, 2, 6] If reading > previous Set changes to changes + 1 Else Set changes to changes - 1 Set previous to reading

What value does the algorithm produce for changes?

Show Answer

Correct Answer

B

Option B is correct because the comparisons change changes by -1, then +1, then -1, then +1, leaving it at 0. Option A is not correct because it misses the increases for readings above the previous reading. Option C is not correct because it counts increases but does not subtract for decreases. Option D is not correct because it misses the final increase.

3

Scripting and Programming Foundations

This topic covers foundational programming concepts and the ways programs are translated and executed. Candidates must distinguish compiled execution from interpreted execution and understand how those approaches affect builds and runtime requirements.

Question 7 of 10 Single Choice

A team maintains a C desktop utility and a Python report script. After a change to each source file, a technician copies the files to a test workstation but does not run the C build process again. The Python report shows the revised output, while the C utility still shows the previous output. The workstation has the required runtimes and libraries.

Which explanation best accounts for the different results?

Show Answer

Correct Answer

A

Option A is correct because the C executable reflects the source used at the last build, while the Python interpreter reads the edited script when it is launched. Option B is not correct because the C executable does not consult its source file during normal execution. Option C is not correct because interpretation does not permanently replace the script with a native executable. Option D is not correct because C compilation occurs before execution.

Question 8 of 10 Single Choice

A company builds a C command-line tool on a Linux workstation and copies the resulting executable to another Linux workstation with the same processor architecture. The second workstation has the needed native libraries but no C compiler, and the tool runs there. A Python maintenance script copied to that workstation does not run because Python is not installed. The operations lead asks what this demonstrates about their execution models.

Which statement best explains why the two programs behave differently on the second workstation?

Show Answer

Correct Answer

A

Option A is correct because the copied C executable already contains translated machine instructions, while the Python script needs a compatible interpreter at runtime. Option B is not correct because compilation is not repeated whenever a native executable starts. Option C is not correct because Python bytecode generation does not remove the need for a Python runtime. Option D is not correct because native machine code is built for a target platform and is not universally portable.

4

Using Fundamental Programming Elements

This topic covers the use of variables, loops, and conditions in small programs. Candidates must apply these elements to process data and produce results that meet stated requirements.

Question 9 of 10 Single Choice

A warehouse receiving tool reads one batch of line items from a CSV file. Each parsed line has a quantity stored as an integer, and the batch may contain no rows or rows with quantity zero. The report must show the total units across every row, preserve the parsed rows unchanged, and produce zero for an empty batch.

Which implementation plan satisfies the report requirements?

Show Answer

Correct Answer

A

Option A is correct because starting at zero and adding every row quantity also returns zero when the batch is empty. Option B is not correct because starting at one adds an unwanted unit. Option C is not correct because assignment replaces the running total with the latest quantity. Option D is not correct because omitting the first row leaves its quantity out of the total.

Question 10 of 10 Single Choice

A service desk report reads tickets with Boolean fields named customer_confirmed and technician_assigned. It must count a ticket as ready only when both fields are true. Every other ticket counts as waiting, and each ticket must contribute to exactly one count. The input may be empty, and the source records cannot be modified.

Which implementation plan counts the tickets correctly?

Show Answer

Correct Answer

A

Option A is correct because both counters start at zero and the if-else sends each ticket to exactly one category, including when the input is empty. Option B is not correct because OR marks a ticket ready when only one required field is true. Option C is not correct because ready tickets remain included in the initial waiting count. Option D is not correct because tickets with mixed field values are not counted as waiting.

Continue Your Scripting-and-Programming-Foundations Preparation

You have seen 10 questions from a full set of 138. Prepare with the Scripting-and-Programming-Foundations dumps PDF and the Web-Based Practice Test.

PDF

  • Compatible with All Devices
  • Printable Format
  • No Download Limits

Practice Test

  • Check your timing and weak areas
  • No Practice Limits
  • Regularly Updated
Get Full Access
  • 100% Money-Back Guarantee
  • 90 Days Free Updates
  • Instant Access

Frequently Asked Questions

Why can tracing simple algorithms be harder than it first appears?

A short algorithm can still be easy to misread when each step changes a value or a condition determines which step runs next. The challenge is to follow the stated order and apply every rule to the current value, rather than infer what the code might mean. Build a small trace table with columns for the input, each changed variable, and the output. This makes skipped steps and mistaken condition checks visible.

Why does choosing a script for a workplace requirement feel less direct than learning syntax?

A script that works in one setting may not fit another. This topic asks you to account for the operating environment, available tools, and deployment limits before choosing an approach. Candidates can get frustrated by focusing on what a language can do instead of what the stated workplace requirement permits. The Exam4Success PDF can help you review these decision factors away from a coding environment. Practise stating the requirement and constraints before proposing a script.

What practical ability should I hope to build from these foundations?

The topics are aimed at helping you reason about small programs, not merely recognize programming terms. You work with variables, loops, and conditions to process data, trace an algorithm, and decide whether a scripting approach suits a requirement. Those are useful foundations for further programming study and for understanding basic automation tasks. Treat each exercise as a chance to explain how an input becomes an output, then identify which programming element made that result possible.

How should I decide what to study first?

Start by checking whether you can explain the difference between compiled and interpreted execution, then trace a small algorithm and use variables, loops, and conditions in a simple program. These topics build on one another, so gaps in tracing can make later code exercises harder to assess. Use a Practice Test to identify which areas need the most attention, then return to focused review rather than repeating material you already understand. Keep a short list of errors and their causes.

What makes compiled and interpreted execution confusing?

The distinction is not just a matter of vocabulary. Candidates need to understand how each approach relates to program translation, builds, and runtime requirements. It can be tempting to memorize labels without considering what must be available for a program to run. Compare the two approaches by asking what happens before execution and what the operating environment needs at runtime. Then connect that comparison to a stated deployment constraint, since that is where the distinction becomes practical.

Why do practice exercises sometimes fail to prepare me for requirement-based questions?

An exercise focused only on writing a loop or condition may not require you to choose an approach, account for available tools, or consider deployment limits. That can leave a gap between knowing a programming element and applying it to a workplace requirement. After solving a code exercise, add a second step. Explain which requirement the code meets and what assumptions its operating environment requires. The Exam4Success guide can support that kind of review when you are away from a coding setup.

Can this exam help me prepare for more advanced programming study?

The listed topics provide a starting point for later learning by asking you to reason about algorithm steps, basic control flow, and how programs execute. They do not establish a particular job outcome or guarantee readiness for a specific next certification. A useful goal is to become comfortable explaining a small program in plain language, including its inputs, conditions, and result. Record any concept you cannot yet explain clearly, then use it to guide your next round of study.

How can I tell if I am ready to move from review to final practice?

You are better positioned to move on when you can trace a simple algorithm without skipping updates, select a scripting approach using the stated environment and constraints, and explain how variables, loops, and conditions produce the requested result. A Practice Test can help reveal which of those skills remains inconsistent and let you assess your own working pace. Review errors by topic, not just by answer. Return to the weakest concept and try a fresh example before judging your readiness again.

Exam4Success is an independent exam preparation provider and is not affiliated with or endorsed by WGU.