1. Which two statements describe advantages to using programming libraries?
A. Using libraries turns procedural code into object-oriented code.
B. Using a library prevents a programmer from having to code common tasks by hand. Correct
C. Using a library minimizes copyright issues in coding.
D. A program that uses libraries is more portable than one that does not.
E. The programmer can improve productivity by using libraries. Correct
F. Libraries always make code run faster.
Explanation
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.
2. Which two situations would be helped by using a programming library?
A. A programming student is writing code to iterate through the integers in a list and determine the maximum.
B. A video game programmer needs to perform several animation tasks, all of which are very common in the industry. The programmer does not want to have to code each task, and they are unsure if they even know how to code a few of them. Correct
C. A programmer needs to perform a series of file compression tasks. These tasks are commonly performed by programmers, and the programmer does not want to have to code them all by hand. Correct
D. A programmer needs to write several interacting objects for a student gradebook application, some of which need an inheritance structure.
E. A programmer is developing a database application that can house various types of data. The software cannot know ahead of time the data type, and so the programmer needs variables that do not require an initial declaration type.
F. A programmer is writing a piece of mathematical code that requires the heavy use of recursive functions.
Explanation
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.
3. A programmer is writing code using C. Which paradigm could the programmer be using?
A. A functional paradigm using dynamic types
B. A procedural paradigm using static types Correct
C. An event-driven paradigm using static types
D. A procedural paradigm using dynamic types
Explanation
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.
4. What is an advantage of using a programming library?
A. There is improved programmer productivity. Correct
B. There are more statements in a user’s main function.
C. Programs need not run to yield results.
D. Static program elements are visualized.
Explanation
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.
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?
A. Static
B. Compiled
C. Markup
D. Functional Correct
Explanation
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.