Scripting-and-Programming-Foundations Exam Questions & Answers
WGU Scripting and Programming Foundations Exam • WGU
100% money-back guarantee
Sample Scripting-and-Programming-Foundations Questions
Practice with real exam-style questions, each with the verified correct answer and explanation.
A software developer determines the mathematical operations that a calculator program should support. Which two Waterfall approach phases are involved?
Comprehensive and Detailed Explanation From Exact Extract:
Determining the mathematical operations (e.g., addition, subtraction, multiplication) for a calculator program involves defining what the program should do (requirements) and planning how to achieve it (technical specifications). According to foundational programming principles, this spans the analysis and design phases in the Waterfall methodology.
Waterfall Phases Analysis:
Analysis: The developer identifies the requirements, such as which operations the calculator must support (e.g., ''must perform addition, subtraction, etc.'').
Design: The developer specifies how these operations will be implemented (e.g., defining functions like add(), subtract(), or their algorithms).
Implementation: Codes the operations.
Testing: Verifies the operations work correctly.
Option A: 'Analysis and design.' This is correct. Analysis determines the operations needed (requirements), and design outlines their technical specifications (e.g., function signatures or algorithms).
Option B: 'Design and implementation.' This is incorrect. Implementation involves coding the operations, not determining which operations are needed.
Option C: 'Implementation and testing.' This is incorrect. These phases occur after the operations are determined, focusing on coding and verification.
Option D: 'Design and testing.' This is incorrect. Testing verifies the implemented operations, not their determination.
Certiport Scripting and Programming Foundations Study Guide (Section on Waterfall Phases).
Sommerville, I., Software Engineering, 10th Edition (Chapter 2: Waterfall Model).
Pressman, R.S., Software Engineering: A Practitioner's Approach, 8th Edition (Waterfall Analysis and Design).
A team of programmers describes the objects and functions in a program that compresses files before splitting the objects.
Which two waterfall approach phases are involved?
The Waterfall Model is a sequential design process used in software development, where progress is seen as flowing steadily downwards through several phases like a waterfall. In the context of the question, describing the objects and functions in a program that compresses files before splitting the objects involves two specific phases:
Design Phase: This is where the system's architecture, components, interfaces, and data are all defined. The team would design the objects and functions necessary for the file compression program during this phase.
Implementation (or Development) Phase: Following the design, the actual code is written during the implementation phase. The objects and functions described in the design phase are created and tested to ensure they work as intended.
These two phases are critical in the Waterfall approach for transitioning from an abstract understanding of the problem to a concrete implementation in code. The analysis phase is more about understanding the problem and requirements, while testing is a separate phase that comes after implementation.
GeeksforGeeks article on Waterfall Model1.
Built In's explanation of Waterfall Methodology2.
Forbes Advisor's overview of Waterfall Methodology3.
Which characteristic specifically describes an object-oriented language?
Object-oriented programming (OOP) is characterized by the concept of encapsulating data and operations within objects. This characteristic is fundamental to OOP and distinguishes it from procedural programming, which is structured around functions rather than objects. In OOP, objects are instances of classes, which define the data (attributes) and the operations (methods) that can be performed on that data. This encapsulation of data and methods within objects allows for more modular, reusable, and maintainable code.
The characteristics of object-oriented programming languages are well-documented and include encapsulation, abstraction, inheritance, and polymorphism.These principles are foundational to OOP and are supported by languages like C++, Java, and Python12345.
Which value would require an integer as a data type?
Comprehensive and Detailed Explanation From Exact Extract:
An integer data type is used for whole numbers without fractional parts. According to foundational programming principles, values that represent counts or discrete quantities typically use integers, while values with decimal points or fractional components use floating-point types.
Option A: 'The cost of a dinner including tax and tip.' This is incorrect. Costs typically involve decimal values (e.g., $24.99), requiring a floating-point type (e.g., float or double) to handle cents.
Option B:: 'An approximation of the number pi to five decimal places.' This is incorrect. Pi approximated to five decimal places (e.g., 3.14159) is a decimal number, requiring a floating-point type, not an integer.
Option C: 'The weights of every patient involved in a pharmaceutical trial.' This is incorrect. Weights (e.g., 70.5 kg) typically include decimal points for precision, requiring a floating-point type.
Option D: 'The number of students in a section.' This is correct. The number of students is a whole number (e.g., 25), which is represented by an integer data type (e.g., int in C or Python).
Certiport Scripting and Programming Foundations Study Guide (Section on Data Types).
Python Documentation: ''Built-in Types'' (https://docs.python.org/3/library/stdtypes.html).
W3Schools: ''C Data Types'' (https://www.w3schools.com/c/c_data_types.php).
Which data type should be used to hold the value of a person's body temperature in Fahrenheit?
Comprehensive and Detailed Explanation From Exact Extract:
Body temperature in Fahrenheit typically includes decimal precision (e.g., 98.6F). According to foundational programming principles, a floating-point type is suitable for values with decimal components.
Option A: 'Integer.' This is incorrect. Integers cannot store decimal values, and body temperature often requires precision (e.g., 98.6 99).
Option B: 'String.' This is incorrect. While a string could store '98.6' as text, it's not suitable for numerical calculations (e.g., averaging temperatures).
Option C: 'Float.' This is correct. A floating-point type (float) can store decimal values like 98.6, making it ideal for body temperature. For example, in C: float temp = 98.6;.
Option D: 'Boolean.' This is incorrect. Booleans store true/false values, not numerical temperatures.
Certiport Scripting and Programming Foundations Study Guide (Section on Data Types).
Python Documentation: ''Floating Point Types'' (https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex).
W3Schools: ''C Data Types'' (https://www.w3schools.com/c/c_data_types.php).
Get access to all 138 verified questions with detailed answers.
Unlock All Scripting-and-Programming-Foundations Questions