WGU Scripting and Programming Foundations Exam Questions

Page: 1 / 14
Total 138 questions
Question 1

Which characteristic distinguishes a markup language from other languages



Answer : B

Markup languages, such as HTML, XML, and SGML, are distinct from programming languages in that they are used for structuring, formatting, and defining the presentation of content within documents.They utilize tags to denote how elements should be displayed, but do not contain logic or algorithms to perform computations or process data123.Instead, markup languages are concerned with the layout and organization of text and images, making them more descriptive and less about executing tasks4.


GeeksforGeeks' explanation of different markup languages1.

Semrush's definition and examples of markup languages2.

An article on Medium about how markup languages differ from compiled languages4.

GeeksforGeeks' comparison between programming, scripting, and markup languages3.

Question 2

Which statement describes a compiled language?



Answer : D

A compiled language is one where the source code is translated into machine code, which is a set of instructions that the computer's processor can execute directly. This translation is done by a program called a compiler. Once the source code is compiled into an executable file, it can be run on the target machine without the need for the original source code or the compiler. This process differs from interpreted languages, where the code is executed one statement at a time by another program called an interpreter, and there is no intermediate executable file created.

Option A describes an interpreted language, not a compiled one. Option B refers to type safety, which is a feature of some programming languages but is not specific to compiled languages. Option C describes a script or an interpreted language, which can be executed immediately by an interpreter without compilation.


Question 3

The steps in an algorithm to find the maximum of integers a and b are given.

Which two steps of the algorithm should be switched to make the algorithm successful?



Answer : C

The variablemaxshould be declared before it is used. So, the corrected algorithm would be:

Declare variable max.

Set max = a.

If b > max, set max = b.

Put max to output.

This way, the variablemaxis declared before being assigned the value ofa, and the rest of the algorithm can proceed as given. Thank you for the question! Let me know if you have any other queries.


Question 4

One requirement for the language of a protect is that it is based on a series of method calls.

When type of language is characterized in this way?



Answer : C

A language characterized by a series of method calls is typically referred to as a functional language. In functional programming, computation is treated as the evaluation of mathematical functions and avoids changing-state and mutable data. It is a declarative programming paradigm, which means programming is done with expressions or declarations instead of statements. In functional languages, functions are first-class citizens, meaning they can be passed as arguments to other functions, returned as values from other functions, and assigned to variables.


Question 5

A programming team is using the Waterfall design approach to create an application. Which deliverable would be produced during the design phase?



Answer : A

Comprehensive and Detailed Explanation From Exact Extract:

The Waterfall methodology is a linear, sequential approach to software development, with distinct phases: requirements analysis, design, implementation, testing, and maintenance. According to foundational programming principles (e.g., Certiport Scripting and Programming Foundations Study Guide), the design phase in Waterfall produces technical specifications, including architectural decisions like the programming paradigm.

Waterfall Design Phase:

Translates requirements into a detailed blueprint for implementation.

Deliverables include system architecture, data models, programming paradigm (e.g., object-oriented, procedural), and module specifications.

Option A: 'The programming paradigm to be used.' This is correct. During the design phase, the team decides on the programming paradigm (e.g., object-oriented for Java, procedural for C) to structure the application, as this guides implementation. This is a key deliverable.

Option B: 'A list of additional features to be added during revision.' This is incorrect. Additional features are identified during requirements analysis or later maintenance phases, not design.

Option C: 'A report of customer satisfaction.' This is incorrect. Customer satisfaction reports are generated during or after deployment (maintenance phase), not design.

Option D: 'A written description of the goals for the project.' This is incorrect. Project goals are defined during the requirements analysis phase, not design.

Certiport Scripting and Programming Foundations Study Guide (Section on Waterfall Methodology).

Sommerville, I., Software Engineering, 10th Edition (Chapter 2: Waterfall Model).

Pressman, R.S., Software Engineering: A Practitioner's Approach, 8th Edition (Waterfall Design Phase).


Question 6

An algorithm should output ''OK'' if a number is between 98.3 and 98.9, else the output is ''Net OK''

Which test is a valid test of the algorithm?



Answer : B

The algorithm is designed to output ''OK'' if the input number is within the range of 98.3 to 98.9. Therefore, the valid test would be one that checks if the algorithm correctly identifies a number within this range and outputs ''OK''. Option B provides an input of 98.6, which falls within the specified range, and expects the correct output of ''OK'', making it a valid test case for the algorithm.


1: Stack Overflow - How to decide test cases for unit tests?2: Analytics Vidhya - Writing Test Cases for Machine Learning systems3: LinkedIn - How to Choose the Best Test Cases for Your Algorithm

Question 7

Which characteristic distinguishes an object-oriented language from other languages?



Answer : A

The defining characteristic of an object-oriented language is its support for objects and classes, which encapsulate data and behavior. This includes the ability to define custom variable types (classes) with their own methods, and the use of key principles such as information hiding, data abstraction, encapsulation, polymorphism, and inheritance. These features distinguish object-oriented languages from procedural languages, which do not typically support these concepts in the same way.


Page:    1 / 14   
Total 138 questions