WGU Scripting-and-Programming-Foundations Practice Exam Questions & Answers

6 Free Questions · Last reviewed: October 8, 2026 · Prepared & Reviewed by the ValidExamDumps Editorial Team

Exam Facts

WGU Scripting-and-Programming-Foundations Exam Details

Key details for this exam, checked against the published exam outline

138 Practice Questions (Our Bank)
Exam Code
Scripting-and-Programming-Foundations
Full Name
WGU Scripting and Programming Foundations Exam
Issuing Body
Western Governors University
Question Format (Our Bank)
Multiple Choice, Hotspot
Practice Questions

Free Scripting-and-Programming-Foundations Practice Questions

Each question shows the correct answer and an explanation of why it is right

VA
ValidExamDumps Editorial Team Every question and its answer is checked by our Scripting-and-Programming-Foundations exam preparation team, who also write the explanation shown with each one. How we research and review these pages

What is the proper way to declare a student's grade point average throughout the term if this item is needed in several places in a program?

Correct Answer: A
Explanation

Comprehensive and Detailed Explanation From Exact Extract:

A grade point average (GPA) is a numerical value that typically includes decimal places (e.g., 3.75). According to foundational programming principles, it should be declared as a variable if it may change (e.g., as grades are updated) and as a floating-point type to accommodate decimals.

Option A: 'Variable float gpa.' This is correct. GPA requires a floating-point type (float) to handle decimal values, and since it may change over the term, it should be a variable, not a constant. For example, in C: float gpa = 3.5;.

Option B: 'Constant float gpa.' This is incorrect. A constant (const in C) cannot be modified after initialization, but GPA may change as new grades are added.

Option C: 'Variable int gpa.' This is incorrect. An integer (int) cannot store decimal values, which are common in GPAs (e.g., 3.2).

Option D: 'Constant int gpa.' This is incorrect. GPA requires a float for decimals and a variable for mutability, making both const and int unsuitable.

Certiport Scripting and Programming Foundations Study Guide (Section on Variables and Data Types).

C Programming Language Standard (ISO/IEC 9899:2011, Section on Floating Types).

W3Schools: ''C Variables'' (https://www.w3schools.com/c/c_variables.php).

Which kind of languages are C, C++ and Java?

Correct Answer: B
Explanation

C, C++, and Java are all considered compiled languages. This means that the code written in these languages is not executed directly by the hardware but must first be translated into machine code by a compiler.

Cis a general-purpose programming language that is compiled to generate machine code which can be executed directly by the computer's CPU1.

C++is an extension of C that includes object-oriented features.It is also a compiled language, where the source code is converted into machine code that can be executed by the CPU2.

Javais a bit unique because it is compiled into bytecode, which is then run on a virtual machine (JVM) rather than directly by the CPU.However, it is still considered a compiled language because the source code is compiled before it is executed2.


Understanding of the compilation process for C, C++, and Java.

Official documentation and language specifications for C, C++, and Java.

Articles and resources on programming language paradigms and compiler design.

The steps in an algorithm to buy a pair of shoes from a store are given in no particular order.

* Bring the shoes to the cashier

* Pay for the shoes

* Enter the store

* Select the pair of shoes

What is the first step of the algorithm?

Correct Answer: C
Explanation

An algorithm is a set of step-by-step instructions for completing a task. In the context of buying a pair of shoes from a store, the first logical step would be toenter the store. This is because one cannot select a pair of shoes, bring them to the cashier, or pay for them without first entering the store. The steps should follow a logical sequence based on the dependencies of each action:

Enter the store- This is the initial step as it allows access to the shoes available for purchase.

Select the pair of shoes- Once inside, the next step is to choose the desired pair of shoes.

Bring the shoes to the cashier- After selection, the shoes are taken to the cashier for payment.

Pay for the shoes- The final step is the transaction to exchange money for the shoes.


The concept of algorithms and their properties can be found in computer science and programming literature, such as ''Introduction to Algorithms'' by Cormen, Leiserson, Rivest, and Stein.

The logical ordering of steps in a process is a fundamental aspect of algorithm design, which is covered in foundational programming and scripting courses.

Given integer x = 12 and integer y = 4. What is the value of the expression x - y * 2?

Correct Answer: A
Explanation

Comprehensive and Detailed Explanation From Exact Extract:

The expression x - y * 2 involves subtraction and multiplication, evaluated according to operator precedence. According to foundational programming principles (e.g., C and Python standards), multiplication (*) has higher precedence than subtraction (-), so y * 2 is computed first.

Given: x = 12, y = 4.

Compute: y * 2 = 4 * 2 = 8.

Then: x - (y * 2) = 12 - 8 = 4.

Option A: '4.' This is correct, as calculated above.

Option B: '6.' This is incorrect. It might result from misinterpreting precedence (e.g., (x - y) * 2 = (12 - 4) * 2 = 16).

Option C: '8.' This is incorrect. It might result from computing x - y = 12 - 4 = 8 and ignoring * 2.

Option D: '14.' This is incorrect. It does not align with the expression's evaluation.

Certiport Scripting and Programming Foundations Study Guide (Section on Operator Precedence).

C Programming Language Standard (ISO/IEC 9899:2011, Section on Expressions).

W3Schools: ''Python Operators'' (https://www.w3schools.com/python/python_operators.asp).

Which kind of languages are C and Java?

Correct Answer: B
Explanation

Comprehensive and Detailed Explanation From Exact Extract:

C and Java are both compiled languages, though they differ in their compilation process. According to foundational programming principles, C is compiled directly to machine code, while Java is compiled to bytecode, which is executed by the Java Virtual Machine (JVM).

Option A: 'Machine code.' This is incorrect. Machine code is the low-level output of a compiler, not a programming language. C and Java are high-level languages.

Option B: 'Compiled.' This is correct. C is compiled to machine code (e.g., .exe files), and Java is compiled to bytecode (.class files), which is then executed by the JVM. Both require a compilation step before execution.

Option C: 'Interpreted.' This is incorrect. Neither C nor Java is interpreted. While Java's bytecode is executed by the JVM, the compilation to bytecode distinguishes it from interpreted languages like Python, which execute source code directly.

Option D: 'Markup.' This is incorrect. Markup languages (e.g., HTML) are used for structuring content, not programming. C and Java are programming languages.

Certiport Scripting and Programming Foundations Study Guide (Section on Compiled Languages).

Java Documentation: ''The Java Compiler'' (https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html).

W3Schools: ''C Introduction'' (https://www.w3schools.com/c/c_intro.php).

Which two types of operators are found in the code snippet not (g != S)?

Correct Answer: C
Explanation

The code snippetnot (g != S)contains two types of operators:

Equality Operator (!=): The expressiong != Schecks whether the value ofgisnot equalto the value ofS. The!=operator is used for comparison and returnsTrueif the values are different, otherwiseFalse.

Logical Operator (not): Thenotoperator is alogical negationoperator. Itinvertsthe truth value of a Boolean expression. In this case,not (g != S)evaluates toTrueifgis equal toS, andFalseotherwise.

Therefore, the combination of these two operators results in the overall expressionnot (g != S).


The concept of equality and logical operators is covered in programming documentation and tutorials, such as GeeksforGeeks1and Real Python2.

The Python documentation provides details on logical operators and their usage2.

Full Access

Get the complete Scripting-and-Programming-Foundations question set

  • 138 questions covering all exam domains
  • Correct answers with explanations, like the free questions above
  • PDF and online practice test
  • 90 days of free updates
Starting from 50% OFF
$20 $40
Get Full Access

One-time payment · Instant download

Study Guide

What the WGU Scripting-and-Programming-Foundations Exam Covers

Exam domains verified against: Official WGU Scripting-and-Programming-Foundations exam guide, last checked October 2026.

Domain 1: Identifying Scripts for Computer Program Requirements

Choose the correct script or coding method for specific needs. Different scripts meet certain requirements and help identify suitable structures for solving defined programming tasks.

Sample question from this domain above: Q2

Domain 2: Explaining Logic and Outcomes of Simple Algorithms

Understand how simple algorithms function. Predict outcomes, follow logical steps, and see how basic instructions produce final results to build confidence in reading and interpreting algorithm behavior.

Domain 3: Scripting and Programming Foundations

Learn core principles of programming including variables, data types, flow control, and simple design ideas. Understand how various languages perform similar operations and the distinction between interpreted and compiled languages.

Sample questions from this domain above: Q1Q3Q5

Domain 4: Using Fundamental Programming Elements

Apply essential programming components including variables, loops, conditions, and simple logic to perform common functions. Use these elements correctly to complete small programs in an organized and effective way.

Sample questions from this domain above: Q4Q6

FAQ

Scripting-and-Programming-Foundations Exam FAQ

Common questions about the exam itself

What is the Scripting and Programming Foundations exam and who should take it?
This is a WGU objective assessment that measures entry-level programming competency across core scripting and programming concepts. It is designed for junior software developers and entry-level programmers pursuing WGU courses and certifications who need to demonstrate foundational knowledge in coding logic and script implementation.
What background do I need before attempting the Scripting and Programming Foundations exam?
There are no formal prerequisites listed, but the exam assumes basic familiarity with fundamental programming concepts. Most candidates take this exam as part of the WGU D278 course, which provides the necessary foundation in variables, data types, algorithms, and control structures.
Which objective area is typically the hardest part of the Scripting and Programming Foundations exam?
Explaining logic and outcomes of simple algorithms tends to challenge candidates the most because it requires predicting program behavior and tracing execution steps. Spend extra time working through algorithm walkthroughs and practice tracing code execution manually before test day.
How long does it typically take to prepare for the Scripting and Programming Foundations exam?
Most candidates need four to eight weeks of focused study, depending on their programming background and how much time they commit per week. The WGU course itself is designed to be completed in about two months.
What is the format of the Scripting and Programming Foundations exam?
The exam uses multiple question types including multiple choice, scenario-based items, and code interpretation questions. These assess both conceptual knowledge and applied reasoning in areas like variable usage, loop structures, conditional logic, and algorithm analysis.
Can I retake the Scripting and Programming Foundations exam if I don't pass?
WGU allows candidates to retake the objective assessment, but specific retake policies and any waiting periods between attempts are determined by WGU's course completion rules. Contact your WGU course instructor for details on retake eligibility within your specific program.
How long is the Scripting and Programming Foundations certification valid after I pass?
The exam is an objective assessment within a WGU course rather than a time-limited certification. Once you complete the course successfully, the competency is demonstrated as part of your academic record, which does not expire.
What job roles does the Scripting and Programming Foundations exam prepare me for?
This exam validates skills for entry-level programming positions such as junior software developer, junior programmer, or IT support technician. The foundational knowledge in scripting and algorithms provides a stepping stone toward more specialized programming and software development roles.
How does the Scripting and Programming Foundations exam relate to other WGU programming courses?
This course is typically the first programming course in WGU IT degree paths and lays the groundwork for more advanced courses like Java development, full-stack web development, and system design. Success in this exam demonstrates readiness for higher-level programming coursework.