Key details for this exam, checked against the published exam outline
Each question shows the correct answer and an explanation of why it is right
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?
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?
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?
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?
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?
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)?
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.
Exam domains verified against: Official WGU Scripting-and-Programming-Foundations exam guide, last checked October 2026.
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
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.
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.
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.
Common questions about the exam itself