WGU D278 SCRIPTING AND PROGRAMMING
FOUNDATIONS — OA OBJECTIVE
ASSESSMENT 200 Practice Questions with
Verified Answers and Detailed Rationales
Course: D278 – Scripting and Programming Foundations
Institution: Western Governors University (WGU)
Exam: Objective Assessment (OA)
Format: Multiple-choice, scenario-based, and applied coding questions
Key Content Areas: Programming Paradigms & Language Types, Data Types & Variables,
Operators & Expressions, Control Structures (Conditional Statements), Loops & Iteration,
Functions & Modular Programming, Arrays & Data Structures, Input/Output & File Processing,
Libraries & Code Reuse, Software Development Life Cycle & Methodologies
SECTION 1: PROGRAMMING PARADIGMS & LANGUAGE TYPES (Questions 1–30)
1. Which programming paradigm focuses on the use of classes and objects to encapsulate data
and behavior?
- A) Procedural
- B) Functional
- C) Object-oriented
- D) Declarative
Answer: C
Rationale: Object-oriented programming (OOP) organizes code into classes that define objects
with attributes (data) and methods (behavior). Procedural focuses on procedures/functions;
functional uses pure functions; declarative focuses on logic without control flow.
2. A language that requires explicit declaration of a variable's data type before compilation is
called:
- A) Dynamically typed
,- B) Statically typed
- C) Weakly typed
- D) Scripting language
Answer: B
Rationale: Statically typed languages (e.g., Java, C++) enforce type checking at compile time.
Dynamically typed languages (e.g., Python, JavaScript) check types at runtime.
3. Which of the following is a characteristic of a scripting language?
- A) Requires compilation before execution
- B) Typically interpreted at runtime
- C) Always statically typed
- D) Cannot be used for web development
Answer: B
Rationale: Scripting languages (Python, JavaScript, Ruby) are typically interpreted at runtime
rather than compiled. They are often dynamically typed and widely used for web development.
4. A language uses tags around text to indicate how that text should be formatted. Which
characteristic describes a language having such tags?
- A) Interpreted
- B) Compiled
- C) Markup
- D) Object-oriented
Answer: C
Rationale: Markup languages like HTML use tags to describe formatting and structure. Tags
surround text to indicate how it should be displayed or processed.
5. Which language is dynamically typed?
- A) C++
- B) Java
- C) Python
- D) C
Answer: C
Rationale: Python is dynamically typed, meaning variable types are determined at runtime. C++,
Java, and C are statically typed languages.
,6. Which language is NOT built on object-oriented design principles?
- A) Java
- B) Python
- C) C
- D) C++
Answer: C
Rationale: C is a procedural language and is not built on object-oriented design principles. Java,
Python, and C++ support object-oriented programming.
7. A language substantially supports a programmer creating items like person, teacher, and
students. Each item has internal data and some operations. Which characteristic describes that
language?
- A) Procedural
- B) Functional
- C) Object-oriented
- D) Declarative
Answer: C
Rationale: This describes object-oriented programming, where real-world entities are modeled
as objects with data (attributes) and operations (methods).
8. A programmer wants a compiler to report an error if an integer variable is assigned with a
string. Which kind of language should the programmer use?
- A) Dynamically typed
- B) Statically typed
- C) Weakly typed
- D) Interpreted
Answer: B
Rationale: Statically typed languages perform type checking at compile time and will report an
error if a variable is assigned with an incompatible type.
9. What is a characteristic of a compiled language?
- A) Converts to machine language before running
, - B) Runs easily on different kinds of machines
- C) Can be modified at run time
- D) Executes one statement at a time
Answer: A
Rationale: Compiled languages convert source code to machine language before execution.
This makes them generally faster but less portable than interpreted languages.
10. What is a characteristic of an interpreted language?
- A) Converts to machine language before running
- B) Runs easily on different kinds of machines
- C) Requires explicit compilation
- D) Cannot be modified at run time
Answer: B
Rationale: Interpreted languages run easily on different machines because they are executed by
an interpreter that handles platform-specific details.
11. What is an advantage of interpreted programs?
- A) They run faster than compiled programs
- B) They can be modified at run time
- C) They do not require a runtime environment
- D) They always use less memory
Answer: B
Rationale: Interpreted programs can be modified at run time because the source code is
available and executed directly by the interpreter.
12. Which characteristic specifically describes a markup language?
- A) Tags surround text to describe desired formatting
- B) It is always compiled
- C) It uses classes and objects
- D) It is a low-level language
Answer: A
Rationale: Markup languages use tags to describe formatting and structure. HTML is a classic
example.
FOUNDATIONS — OA OBJECTIVE
ASSESSMENT 200 Practice Questions with
Verified Answers and Detailed Rationales
Course: D278 – Scripting and Programming Foundations
Institution: Western Governors University (WGU)
Exam: Objective Assessment (OA)
Format: Multiple-choice, scenario-based, and applied coding questions
Key Content Areas: Programming Paradigms & Language Types, Data Types & Variables,
Operators & Expressions, Control Structures (Conditional Statements), Loops & Iteration,
Functions & Modular Programming, Arrays & Data Structures, Input/Output & File Processing,
Libraries & Code Reuse, Software Development Life Cycle & Methodologies
SECTION 1: PROGRAMMING PARADIGMS & LANGUAGE TYPES (Questions 1–30)
1. Which programming paradigm focuses on the use of classes and objects to encapsulate data
and behavior?
- A) Procedural
- B) Functional
- C) Object-oriented
- D) Declarative
Answer: C
Rationale: Object-oriented programming (OOP) organizes code into classes that define objects
with attributes (data) and methods (behavior). Procedural focuses on procedures/functions;
functional uses pure functions; declarative focuses on logic without control flow.
2. A language that requires explicit declaration of a variable's data type before compilation is
called:
- A) Dynamically typed
,- B) Statically typed
- C) Weakly typed
- D) Scripting language
Answer: B
Rationale: Statically typed languages (e.g., Java, C++) enforce type checking at compile time.
Dynamically typed languages (e.g., Python, JavaScript) check types at runtime.
3. Which of the following is a characteristic of a scripting language?
- A) Requires compilation before execution
- B) Typically interpreted at runtime
- C) Always statically typed
- D) Cannot be used for web development
Answer: B
Rationale: Scripting languages (Python, JavaScript, Ruby) are typically interpreted at runtime
rather than compiled. They are often dynamically typed and widely used for web development.
4. A language uses tags around text to indicate how that text should be formatted. Which
characteristic describes a language having such tags?
- A) Interpreted
- B) Compiled
- C) Markup
- D) Object-oriented
Answer: C
Rationale: Markup languages like HTML use tags to describe formatting and structure. Tags
surround text to indicate how it should be displayed or processed.
5. Which language is dynamically typed?
- A) C++
- B) Java
- C) Python
- D) C
Answer: C
Rationale: Python is dynamically typed, meaning variable types are determined at runtime. C++,
Java, and C are statically typed languages.
,6. Which language is NOT built on object-oriented design principles?
- A) Java
- B) Python
- C) C
- D) C++
Answer: C
Rationale: C is a procedural language and is not built on object-oriented design principles. Java,
Python, and C++ support object-oriented programming.
7. A language substantially supports a programmer creating items like person, teacher, and
students. Each item has internal data and some operations. Which characteristic describes that
language?
- A) Procedural
- B) Functional
- C) Object-oriented
- D) Declarative
Answer: C
Rationale: This describes object-oriented programming, where real-world entities are modeled
as objects with data (attributes) and operations (methods).
8. A programmer wants a compiler to report an error if an integer variable is assigned with a
string. Which kind of language should the programmer use?
- A) Dynamically typed
- B) Statically typed
- C) Weakly typed
- D) Interpreted
Answer: B
Rationale: Statically typed languages perform type checking at compile time and will report an
error if a variable is assigned with an incompatible type.
9. What is a characteristic of a compiled language?
- A) Converts to machine language before running
, - B) Runs easily on different kinds of machines
- C) Can be modified at run time
- D) Executes one statement at a time
Answer: A
Rationale: Compiled languages convert source code to machine language before execution.
This makes them generally faster but less portable than interpreted languages.
10. What is a characteristic of an interpreted language?
- A) Converts to machine language before running
- B) Runs easily on different kinds of machines
- C) Requires explicit compilation
- D) Cannot be modified at run time
Answer: B
Rationale: Interpreted languages run easily on different machines because they are executed by
an interpreter that handles platform-specific details.
11. What is an advantage of interpreted programs?
- A) They run faster than compiled programs
- B) They can be modified at run time
- C) They do not require a runtime environment
- D) They always use less memory
Answer: B
Rationale: Interpreted programs can be modified at run time because the source code is
available and executed directly by the interpreter.
12. Which characteristic specifically describes a markup language?
- A) Tags surround text to describe desired formatting
- B) It is always compiled
- C) It uses classes and objects
- D) It is a low-level language
Answer: A
Rationale: Markup languages use tags to describe formatting and structure. HTML is a classic
example.