Programming Paradigms
- 79Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
79 questions
- 1Learning several programming languages can help separate a programming concept from the particular_____used to express it.
Hint
Think about what differs between languages even when they implement the same idea.
Answer
syntax
- 2The ability to recognize the same ideas appearing in different languages comes from understanding them at a_____level.
Hint
This level concerns what an idea means, rather than how it is written.
Answer
conceptual
- 3Conditions, collections, arithmetic, and loading and storing values are examples of ideas that recur across_____.
Hint
These concepts are not restricted to one programming system.
Answer
languages
- 4A language can be especially suitable for some problems and less suitable for others because programming languages have different_____.
Hint
Think about what makes one tool a better fit than another for a particular task.
Answer
strengths
- 5In the introductory course described, students solved the same problem in several languages to explore different programming_____.
Hint
These are broad approaches to organizing and expressing programs.
Answer
paradigms
- 6A paradigm in which instructions are generally written as one action followed by another is_____programming.
Hint
This style often reads like a sequence of steps.
Answer
procedural
- 7The idea that lets programmers apply a general concept without tying it to one language's syntax is an_____.
Hint
It captures an idea at a higher level than its particular implementation.
Answer
abstraction
- 8When a programmer can work productively in many programming languages, that person can be described as a_____.
Hint
The term is also used for someone who speaks many human languages.
Answer
polyglot
- 9In object-oriented programming, an object encapsulates_____and behavior.
Hint
This includes the information an object stores about itself.
Answer
state
- 10Fields, attributes, and instance variables are different names for data that represents an object's_____.
Hint
This is the information an object maintains internally.
Answer
state
- 11In an object, behavior is commonly implemented using_____.
Hint
These are operations that can be performed by or on an object.
Answer
methods
- 12In Ruby, an object refers to itself using the keyword_____.
Hint
This keyword can be used when an object modifies its own state.
Answer
self
- 13In Ruby, an object requests an operation from another object through_____passing.
Hint
The request can include a method name and arguments.
Answer
message
- 14An object is generally an instance of a_____.
Hint
This defines the structure or behavior from which objects are created.
Answer
class
- 15In Ruby, even the value false is an_____.
Hint
Ruby is described as a language in which everything belongs to this category.
Answer
object
- 16In the bank account example, the balance is kept as internal state so outside code cannot directly_____it.
Hint
The design prevents other code from assigning an arbitrary value to the balance.
Answer
set
- 17The Ruby declaration used to expose a read-only accessor for the bank account balance is_____.
Hint
Its name indicates that it provides a way to read an attribute.
Answer
attr_reader
- 18To avoid precision problems when representing money in code, the example stores it as an integer number of_____.
Hint
This represents money in whole units of the smallest common currency subdivision.
Answer
cents
- 19A bank account's deposit operation increases its balance, while its withdraw operation_____the balance.
Hint
Consider what happens to the account balance when money is taken out.
Answer
subtracts from
- 20Objects can model familiar things, such as a chair with a color attribute and behavior that can_____someone up.
Hint
This is an example of behavior associated with the real-world object.
Answer
hold
- 21Reusing standard-library objects such as arrays, hashes, and strings avoids repeatedly implementing common operations like array length; this is object_____.
Hint
The same established components can be applied in many programs.
Answer
reuse
- 22Object-oriented code can be tested by checking an object in isolation and then testing the_____between objects.
Hint
These are the points where separate components meet.
Answer
seams
- 23Pure functional programming avoids storing state and avoids_____the input data.
Hint
A function should not change the original data it receives.
Answer
mutating
- 24For a pure function, the output depends on the input rather than on the program's_____.
Hint
The same input should give the same result regardless of what happened earlier.
Answer
history
- 25Unlike object-oriented programming, functional programming treats data and procedures, or state and behavior, as_____.
Hint
They are not bundled together in a single object in the approach being described.
Answer
separate
- 26In Racket, an operation such as addition is written with the operator before its arguments, using_____notation.
Hint
The operator appears at the beginning of the expression.
Answer
prefix
- 27Prefix notation can apply an arithmetic operator to several arguments in one expression, rather than limiting it to_____arguments.
Hint
This is the number of operands typically used with an infix operator in the comparison.
Answer
two
- 28In nested prefix expressions, parentheses make the order of operations especially_____.
Hint
The grouping clearly shows which operations happen within other operations.
Answer
explicit
- 29In Racket, a function is declared using the keyword_____followed by its name, arguments, and body.
Hint
This keyword begins a definition.
Answer
define
- 30The Racket conditional construct used in the examples, and described as similar to Ruby's case statement, is_____.
Hint
Its name is short for conditional.
Answer
cond
- 31In Racket, the first element of a list can be obtained with_____, while the rest of the list can be obtained with cdr.
Hint
This traditional Lisp list operation corresponds to the head of a list.
Answer
car
- 32The Racket operation that combines an item with a list to form a new list is_____.
Hint
It can place one item at the front of an existing list.
Answer
cons
- 33In Racket, a quoted list is marked so the language treats it as data rather than trying to evaluate it as a_____call.
Hint
Without the quote, a parenthesized expression could be interpreted as an invocation.
Answer
function
- 34The factorial example uses recursion and returns 1 when its input is 1 or less; this is the_____case.
Hint
This case stops a recursive definition from continuing indefinitely.
Answer
base
- 35For an input greater than 1, the factorial example multiplies the input by the factorial of the input_____
Hint
Each recursive call moves toward the base case by reducing the input.
Answer
minus
- 36In the Fibonacci example, a positive input greater than 1 is handled by summing the previous two Fibonacci_____.
Hint
The recursive rule uses the results for the two immediately smaller positions.
Answer
numbers
- 37Because pure functional programs do not share mutable memory, they avoid many concurrency concerns such as needing to_____tables.
Hint
This action is often used to control access to shared mutable resources.
Answer
lock
- 38For a pure function, automated tests can focus on supplying input and checking output without first arranging the state of an underlying_____.
Hint
This is the stateful component that an object-oriented test might need to prepare.
Answer
object
- 39Prolog is based on formal_____, using ideas such as facts, implications, and relationships.
Hint
It is the field that studies valid reasoning and propositions.
Answer
logic
- 40Instead of describing how to solve a problem step by step, Prolog describes_____about the situation.
Hint
This contrasts with specifying the procedure or sequence of actions.
Answer
what
- 41Prolog programs are made up of facts and_____rather than conventional instruction sequences.
Hint
Rules are included in this category of statements.
Answer
clauses
- 42Prolog uses a capital initial letter to distinguish a_____from a constant.
Hint
It can be matched with a value that makes a rule or query true.
Answer
variable
- 43In the Prolog syntax described, a fact ends with a_____.
Hint
It is the punctuation mark used at the end of a sentence.
Answer
period
- 44A Prolog rule specifies a_____between facts.
Hint
For example, a rule can say that two places are adjacent when a border fact holds.
Answer
relationship
- 45Prolog tries to assign values to variables so that a query matches known facts; this process is called_____.
Hint
It finds values that fit a stated pattern.
Answer
pattern matching
- 46If Prolog knows only that Washington borders Oregon, a rule using that fact alone will not necessarily infer that Oregon borders Washington; the relationship must be made_____.
Hint
This property means the relationship works in both directions.
Answer
symmetric
- 47A Prolog query with a variable asks the system to find a value that makes the stated relationship_____.
Hint
The system searches for a value that satisfies the query.
Answer
true
- 48In the family facts example, the fact that Homer is Bart's father is written with Homer as the first argument and Bart as the_____argument.
Hint
The fact's argument order is father followed by child.
Answer
second
- 49The Prolog sibling rule requires that two people share a parent and are not the_____person.
Hint
This condition prevents someone from being classified as their own sibling.
Answer
same
- 50Prolog can answer questions in either direction, such as finding a parent from a child or finding a child from a parent; this is one of its major_____.
Hint
It is a capability that makes logic programs flexible.
Answer
strengths
- 51Prolog lists can contain different kinds of values and can also contain_____lists.
Hint
These are lists placed inside other lists.
Answer
nested
- 52In Prolog list pattern matching, bar notation separates the first element from the_____of the list.
Hint
This part corresponds to the cdr of a list in the Lisp terminology discussed.
Answer
rest
- 53In Prolog, the anonymous variable indicates that a value is unused or does not matter; it is called a “don't_____” variable.
Hint
The phrase means that any value can occupy this position.
Answer
care
- 54The Prolog member rule checks whether an item is the first element of a list or is a member of the list's_____.
Hint
The recursive case searches the portion after the first element.
Answer
rest
- 55Unlike conventional functions, Prolog rules do not use a return statement; their inputs and results are represented through the rule's_____.
Hint
These are the values and variables listed in a rule's signature.
Answer
arguments
- 56Logic programming can solve a scheduling problem by expressing constraints on time and resources, then searching for a schedule that satisfies them; this is constraint_____.
Hint
It is the programming approach described alongside logic programming.
Answer
programming
- 57The assembly language example has two registers, A and_____.
Hint
This register's name comes from the word data.
Answer
D
- 58The D register is named for its role as the_____register.
Hint
Its name begins with the same letter as this function.
Answer
data
- 59The A register can hold a value or an address; when used to refer to the memory cell at that address, the notation_____is used.
Hint
This notation represents the memory location pointed to by A.
Answer
M
- 60The assembly example has no built-in operations for multiplication or_____.
Hint
This is the inverse arithmetic operation to multiplication.
Answer
division
- 61The assembly example supports bitwise NOT, bitwise AND, and bitwise_____.
Hint
This is the other common bitwise operation paired with AND.
Answer
OR
- 62Assembly computations can be assigned to registers or to_____.
Hint
This is where values can be stored beyond the two registers.
Answer
memory
- 63In the assembly example, the @ notation loads a constant into the_____register.
Hint
This register can also function as an address register.
Answer
A
- 64An assembly label names a program location that can be targeted by a_____.
Hint
This transfers execution to another point in the program.
Answer
jump
- 65In the example assembly, conditional jumps compare a value against_____rather than supporting arbitrary comparison values.
Hint
The jump conditions include greater than or equal to a fixed reference value.
Answer
zero
- 66The unconditional assembly jump is written_____.
Hint
Its name abbreviates the action of transferring program execution.
Answer
JMP
- 67The assembly loop sums values by storing a running total in an accumulator and repeatedly_____a counter.
Hint
The counter moves from five toward zero on each pass.
Answer
decrementing
- 68A procedural program typically expresses a sequence of actions such as doing one thing, then another, and then a final_____.
Hint
This describes the step-by-step structure of procedural code.
Answer
thing
- 69Procedural code is often easy to write because people naturally think in terms of ordered_____.
Hint
These are the actions in a sequence.
Answer
steps
- 70To make change, the cash-register algorithm subtracts the amount owed from the amount the customer_____.
Hint
This is the amount the customer gives the cashier.
Answer
tendered
- 71The change-drawer algorithms assume denominations are ordered from largest to_____.
Hint
The algorithm moves through the denominations in descending value.
Answer
smallest
- 72In the object-oriented change algorithm, the array that records which bills and coins to give the customer is the_____array.
Hint
Its name matches what the cashier gives back.
Answer
change
- 73When the current denomination is larger than the remaining change, the algorithm skips it by advancing to the next_____.
Hint
The next one in the ordered drawer is smaller.
Answer
denomination
- 74When a denomination can be used, the algorithm records it and subtracts its value from the remaining_____.
Hint
This is the amount of change still owed after using a bill or coin.
Answer
amount
- 75The Racket change function returns an empty list when the amount to make is_____.
Hint
No bills or coins are needed in this base case.
Answer
zero
- 76In the Racket change function, if no denominations remain while change is still needed, the function returns_____.
Hint
This result indicates that the available drawer cannot make the requested change.
Answer
false
- 77The Racket change function can skip a denomination that is too large by recursively trying the same amount with the_____denominations.
Hint
These are the denominations after the first one has been excluded.
Answer
remaining
- 78When the Racket change function uses a denomination, it recurses on the reduced amount while keeping the same denomination list, allowing that denomination to be used_____than once.
Hint
The next recursive call does not remove the selected denomination.
Answer
more
- 79The Prolog change rule uses three arguments: the amount, the available bills or coins, and the_____for making change.
Hint
This argument records which bills or coins are used.
Answer
result

Ask anything
We've read this whole study set, so questions about it get the best answers.