WGU D278 Final Exam Prep (Latest
Update ) Scripting and
Programming - Foundations |
Questions and Verified Answers |
100% Correct | Grade A
Section 1: Programming Languages and Paradigms
Question 1
A programming library is used to: (choose two)
A. improve productivity
B. add functionality related to a single purpose
C. replace the need for a compiler
D. execute code faster than native code
Correct Answer: A. improve productivity, B. add functionality related to a
single purpose
Rationale: Libraries provide pre-written code to improve
productivity and add specific functionality. They do not replace
compilers (C) or inherently execute faster than native code (D).
,Question 2
Which language type executes faster?
A. Interpreted language
B. Compiled language
C. Both execute at the same speed
D. Scripting language
Correct Answer: B. Compiled language
Rationale: Compiled languages are translated directly into machine
code, which executes faster than interpreted languages that are
translated line-by-line at runtime.
Question 3
Which language type is NOT written for a specific type of machine?
A. Compiled language
B. Interpreted language
C. Assembly language
D. Machine language
Correct Answer: B. Interpreted language
Rationale: Interpreted languages are platform-independent because
the interpreter handles the translation at runtime. Compiled
languages (A) are machine-specific. Assembly (C) and machine
language (D) are hardware-specific.
Question 4
Which languages are compiled?
A. C, C++, Java, C#
,B. Python, JavaScript, Ruby
C. HTML, CSS, XML
D. SQL, Bash, Perl
Correct Answer: A. C, C++, Java, C#
Rationale: C, C++, Java, and C# are compiled languages (Java is
compiled to bytecode). Python (B) is interpreted. HTML (C) is a
markup language. SQL (D) is a query language.
Question 5
Which languages support object-oriented principles?
A. Python
B. JavaScript
C. C#
D. MATLAB
E. C++
F. Java
G. All of the above
Correct Answer: G. All of the above
Rationale: All listed languages support object-oriented programming
to varying degrees.
Question 6
Which type of language cannot change a variable's type while running the
program?
A. Dynamically typed
B. Statically typed
, C. Loosely typed
D. Weakly typed
Correct Answer: B. Statically typed
Rationale: Statically typed languages require variable types to be
declared and fixed at compile time.
Question 7
Which type of language is considered easier to use?
A. Statically typed
B. Dynamically typed
C. Compiled
D. Assembly
Correct Answer: B. Dynamically typed
Rationale: Dynamically typed languages are often considered easier
because they don't require explicit type declarations.
Question 8
You create an integer variable and assign it a string value. When you run
the program you do not receive an error. What type of language are you
using?
A. Statically typed
B. Dynamically typed
C. Compiled
D. Assembly
Update ) Scripting and
Programming - Foundations |
Questions and Verified Answers |
100% Correct | Grade A
Section 1: Programming Languages and Paradigms
Question 1
A programming library is used to: (choose two)
A. improve productivity
B. add functionality related to a single purpose
C. replace the need for a compiler
D. execute code faster than native code
Correct Answer: A. improve productivity, B. add functionality related to a
single purpose
Rationale: Libraries provide pre-written code to improve
productivity and add specific functionality. They do not replace
compilers (C) or inherently execute faster than native code (D).
,Question 2
Which language type executes faster?
A. Interpreted language
B. Compiled language
C. Both execute at the same speed
D. Scripting language
Correct Answer: B. Compiled language
Rationale: Compiled languages are translated directly into machine
code, which executes faster than interpreted languages that are
translated line-by-line at runtime.
Question 3
Which language type is NOT written for a specific type of machine?
A. Compiled language
B. Interpreted language
C. Assembly language
D. Machine language
Correct Answer: B. Interpreted language
Rationale: Interpreted languages are platform-independent because
the interpreter handles the translation at runtime. Compiled
languages (A) are machine-specific. Assembly (C) and machine
language (D) are hardware-specific.
Question 4
Which languages are compiled?
A. C, C++, Java, C#
,B. Python, JavaScript, Ruby
C. HTML, CSS, XML
D. SQL, Bash, Perl
Correct Answer: A. C, C++, Java, C#
Rationale: C, C++, Java, and C# are compiled languages (Java is
compiled to bytecode). Python (B) is interpreted. HTML (C) is a
markup language. SQL (D) is a query language.
Question 5
Which languages support object-oriented principles?
A. Python
B. JavaScript
C. C#
D. MATLAB
E. C++
F. Java
G. All of the above
Correct Answer: G. All of the above
Rationale: All listed languages support object-oriented programming
to varying degrees.
Question 6
Which type of language cannot change a variable's type while running the
program?
A. Dynamically typed
B. Statically typed
, C. Loosely typed
D. Weakly typed
Correct Answer: B. Statically typed
Rationale: Statically typed languages require variable types to be
declared and fixed at compile time.
Question 7
Which type of language is considered easier to use?
A. Statically typed
B. Dynamically typed
C. Compiled
D. Assembly
Correct Answer: B. Dynamically typed
Rationale: Dynamically typed languages are often considered easier
because they don't require explicit type declarations.
Question 8
You create an integer variable and assign it a string value. When you run
the program you do not receive an error. What type of language are you
using?
A. Statically typed
B. Dynamically typed
C. Compiled
D. Assembly