RH01 Scripting and Programming Foundations Version 2
Practice exam for Western Governors University WGU Exams under Western Governors University Exams (College Exams). 5 sample questions.
Sample Questions
You're viewing a limited preview. Log in and subscribe to access all questions.
Log InExam Questions
Question 1
Which two statements describe advantages to using programming libraries?
Correct Answer: B,E
Rationale: Using a library saves development time by providing pre-written, tested code for common tasks, which directly boosts programmer productivity. Portability is not guaranteed by library use alone, as it depends on the library's compatibility with different systems. Libraries do not inherently change code paradigms, minimize copyright issues, or always improve performance; these are dependent on the specific library and its implementation.
Rationale: Using a library saves development time by providing pre-written, tested code for common tasks, which directly boosts programmer productivity. Portability is not guaranteed by library use alone, as it depends on the library's compatibility with different systems. Libraries do not inherently change code paradigms, minimize copyright issues, or always improve performance; these are dependent on the specific library and its implementation.
Question 2
Which two situations would be helped by using a programming library?
Correct Answer: B,C
Rationale: Common, complex tasks like industry-standard animation and file compression are ideal candidates for library use, as libraries provide reliable, pre-built solutions, saving significant development time and effort. Writing a simple maximum function or designing an object-oriented structure are fundamental programming tasks less likely to require a library. Needing dynamic typing or recursive functions relates to language choice, not library use.
Rationale: Common, complex tasks like industry-standard animation and file compression are ideal candidates for library use, as libraries provide reliable, pre-built solutions, saving significant development time and effort. Writing a simple maximum function or designing an object-oriented structure are fundamental programming tasks less likely to require a library. Needing dynamic typing or recursive functions relates to language choice, not library use.
Question 3
A programmer is writing code using C. Which paradigm could the programmer be using?
Correct Answer: B
Rationale: C is a statically typed language that fundamentally follows a procedural programming paradigm, organizing code into functions and procedures. It is not inherently object-oriented, functional, or event-driven, and it does not support dynamic typing.
Rationale: C is a statically typed language that fundamentally follows a procedural programming paradigm, organizing code into functions and procedures. It is not inherently object-oriented, functional, or event-driven, and it does not support dynamic typing.
Question 4
What is an advantage of using a programming library?
Correct Answer: A
Rationale: The primary advantage of using libraries is improved productivity. Libraries provide pre-written, tested code for common tasks, allowing programmers to avoid reinventing the wheel and focus on the unique aspects of their application. This does not necessarily increase the number of statements in the main function, allow programs to run without execution, or visualize static elements.
Rationale: The primary advantage of using libraries is improved productivity. Libraries provide pre-written, tested code for common tasks, allowing programmers to avoid reinventing the wheel and focus on the unique aspects of their application. This does not necessarily increase the number of statements in the main function, allow programs to run without execution, or visualize static elements.
Question 5
One requirement for the language of a project is that it is based on a series of method calls. Which type of language is characterized in this way?
Correct Answer: D
Rationale: Functional programming languages are characterized by treating computation as the evaluation of mathematical functions and relying on a series of function (method) calls and expressions, often avoiding changing state and mutable data. Static and compiled refer to type checking and execution methods, not the core paradigm. Markup languages describe data presentation.
Rationale: Functional programming languages are characterized by treating computation as the evaluation of mathematical functions and relying on a series of function (method) calls and expressions, often avoiding changing state and mutable data. Static and compiled refer to type checking and execution methods, not the core paradigm. Markup languages describe data presentation.