WGU - SCRIPTING AND PROGRAMMING FOUNDATIONS
- D278 MOST TESTED QUESTIONS AND ANSWERS
GRADED A+ WITH RATIONALES
1. What is the first step a programmer takes to use an existing library in their code?
a. Compile the library
b. Download the source code
c. Include or import the library
d. Write wrapper functions
Rationale: Including/importing makes the library’s functions available to your program.
2. Library functions typically share which common relationship?
a. Same return type
b. Same author
c. Related functionality or purpose
d. Identical performance profiles
Rationale: A library groups functions around a cohesive theme (e.g., string processing).
3. What is a key advantage of using a well-tested programming library?
a. Smaller executable size
b. Faster compile times
c. Reliability due to prior testing
d. Fewer external dependencies
Rationale: Libraries have been used and debugged, reducing your risk of new bugs.
4. Which language is dynamically typed?
a. Java
b. C++
c. Python
d. C#
Rationale: Python determines variable types at runtime rather than compile time.
5. Which language is not primarily built on object-oriented principles?
a. Java
b. C#
c. C
d. Swift
Rationale: C is a procedural language without built-in class/object constructs.
6. A language that lets you define “Person,” “Teacher,” and “Student” as items each with data
and operations is described as:
, ESTUDYR
a. Functional
b. Procedural
c. Object-oriented
d. Markup
Rationale: Object-oriented languages bundle data and methods into classes/objects.
7. To get a compiler to flag x = "hello"; when x was declared as int x;, you need a language that
is:
a. Dynamically typed
b. Statically typed
c. Weakly typed
d. Markup
Rationale: Statically typed languages enforce type rules at compile time.
8. A language using tags (e.g., <title>) to indicate formatting is called a:
a. Scripting language
b. Programming language
c. Markup language
d. Query language
Rationale: Markup languages annotate text with tags for structure/formatting.
9. A characteristic of a compiled language is that it:
a. Runs on any machine without modification
b. Interprets code line by line
c. Translates source to machine code before execution
d. Embeds in HTML
Rationale: Compilation produces native binaries for direct execution by the OS.
10. A characteristic of an interpreted language is that it:
a. Requires a separate compilation step
b. Outputs an executable file
c. Can run on multiple platforms without recompiling
d. Cannot use variables
Rationale: Interpreters read and execute source code directly, allowing portability.
11. An advantage of interpreted programs is:
a. Faster execution speed
b. Smaller memory footprint
c. Ability to modify code at runtime
d. Guaranteed type safety
Rationale: Many interpreters support REPLs or hot-reload for dynamic changes.
12. Which operator should you use to compute miles per gallon from miles and gallons?
a. + (addition)