Deck 13: Computer Programming
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/49
Play
Full screen (f)
Deck 13: Computer Programming
1
In OO programming, a class is a template for a group of
with similar characteristics.

Classes in OO programming
In object-oriented programming, an object refers to an entity, whether the entity is in the form of a person, thing or place. Object refers to single unit of data. Classes are used for defining the objects in a general way. In classes objects with similar characteristics are generalized.
Therefore, the appropriate word to fill in the blank is objects.
In object-oriented programming, an object refers to an entity, whether the entity is in the form of a person, thing or place. Object refers to single unit of data. Classes are used for defining the objects in a general way. In classes objects with similar characteristics are generalized.
Therefore, the appropriate word to fill in the blank is objects.
2
The process of passing certain characteristics from a superclass to a subclass is referred to as
.

Passing characteristics from superclass to subclass
Inheritance is a technique used in object-oriented languages for establishing relationships between two objects or classes. The inherited class is called as super class and the class which inherits is called as base class. By using this property, characteristics of super class is passed to base class. This means the characteristics of super class is used by the base class.
Therefore, the appropriate word to fill in the blank is inheritance.
Inheritance is a technique used in object-oriented languages for establishing relationships between two objects or classes. The inherited class is called as super class and the class which inherits is called as base class. By using this property, characteristics of super class is passed to base class. This means the characteristics of super class is used by the base class.
Therefore, the appropriate word to fill in the blank is inheritance.
3
In a Prolog rule, the :- connecting symbol means
.

Connecting symbol in Prolog rule
A Prolog rule contains head, body and connecting symbol. Refer to the figure "12.48" in the textbook. The outcome of the rule is defined by the head, the connecting symbol ":-" means "if" and body consists of clauses. The arguments that are passed in head are in such a manner that first argument goes in favor of head and second argument goes against argument.
Therefore, the appropriate word to fill in the blank is if.
A Prolog rule contains head, body and connecting symbol. Refer to the figure "12.48" in the textbook. The outcome of the rule is defined by the head, the connecting symbol ":-" means "if" and body consists of clauses. The arguments that are passed in head are in such a manner that first argument goes in favor of head and second argument goes against argument.
Therefore, the appropriate word to fill in the blank is if.
4
The declarative programming paradigm focuses on describing a(n) , whereas the procedural paradigm focuses on algorithms that describe a(n)
.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
5
A Prolog attribute can be a(n)
, such as round (with a lowercase r ), or it can be a(n)
, such as Shape (with an uppercase S ).


Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
6

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
7
A(n)
overflow is a condition in which data in memory exceeds its expected boundaries and flows into memory areas intended for use by other data.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
8

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
9
List and describe three types of errors that are typically found when computer programs are tested.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
10
Have you played violent videogames?
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
11
Do you think that states might be able to craft legislation that limits violent videogame sales without eroding principles of free speech?
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
12
List and describe at least eight tools other than programming languages that programmers use to create computer programs.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
13
Continuing with the carpet example, you devise a set of steps, or a(n)
, to solve the problem. You then use a programming language to write the
shown below, which expresses the algorithm.
Input "Enter the width of the room in feet: "; width
Input "Enter the length of the room in feet: "; length
Print "Carpet needed:"
Print length*width " square feet"
Print (length*width)/9 "square yards"


Input "Enter the width of the room in feet: "; width
Input "Enter the length of the room in feet: "; length
Print "Carpet needed:"
Print length*width " square feet"
Print (length*width)/9 "square yards"
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
14
You've just joined a programming team that is developing a Java program for an earth-moving equipment vendor. The lead programmer shows you a UML with labels such as Cranes, Trucks, and Front-end Loaders. With your background in object-oriented programming, you can tell immediately that these are
, which will be coded as a series of attributes, such as private string manufacturer.



Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
15
Define the term algorithm and explain how it relates to procedural programming.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
16
Describe how the jobs performed by computer programmers differ from the jobs performed by software engineers and systems analysts.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
17
Describe the differences between event-driven, procedural, object-oriented, and declarative paradigms. Provide at least one example of a language that supports each paradigm.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
18
Create a flowchart, structured English, and pseudocode to express the algorithm for tying your shoes.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
19
Computer programming
include procedural, object-oriented, eventdriven, and declarative.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
20
To find errors in a computer program, programmers can use a software tool called a(n)
.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
21
Give an example of a sequence control structure, a selection control structure, and a repetition control structure.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
22
COBOL, Fortran, and C are examples of programming languages used when working with the
paradigm.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
23
A subroutine or procedure is a section of code that is part of a program, but is not included in the main execution path. True or false? 

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
24
Define the following terms associated with object-oriented programming: object, class, superclass, subclass, attribute, message, method, inheritance, polymorphism, and encapsulation.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
25
OO programmers often use
diagrams to plan the classes for a program. (Hint: Use the abbreviation.)

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
26
In an OO program, getArea() would be called a(n)
.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
27
Define the following terms associated with the declarative paradigm: fact, rule, predicate, arguments, goal, instantiation, and backtracking.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
28
In the Prolog fact location(balcony,H1), balcony and H1 are
, whereas location is referred to as the
.


Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
29
Finding the value for a variable while solving a Prolog goal is called
.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
30
Write at least five Prolog facts that describe your relationships to members of your family.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
31
To prevent hackers from guessing the location of critical program elements, programmers can use a technique called
space randomization.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
32

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
33
Describe how buffer overflows and verbose error messages make computer programs vulnerable to hackers.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
34
Do you believe that violent videogames contribute to teen violence?
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
35
While browsing through several programs posted online, you come across the following code and realize it is written using the
programming language.
male(frodo).
male(mungo).
male(largo).
male(balbo).
female(berylla).
female(belladonna).
female(primula).
female(sella).
parents(mungo,berylla,balbo).
parents(frodo,primula,drogo).
parents(largo,berylla,balbo).
parents(sella,berylla,balbo).
brother_of(X,Y):-
male(Y),
parents(X,Mother,Father),
parents(Y,Mother,Father).

male(frodo).
male(mungo).
male(largo).
male(balbo).
female(berylla).
female(belladonna).
female(primula).
female(sella).
parents(mungo,berylla,balbo).
parents(frodo,primula,drogo).
parents(largo,berylla,balbo).
parents(sella,berylla,balbo).
brother_of(X,Y):-
male(Y),
parents(X,Mother,Father),
parents(Y,Mother,Father).
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
36
Create a sentence outline for Section E that focuses on techniques for secure programming.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
37
A friend asks you for help writing a computer program to calculate the square yards of carpet needed for a dorm room. The statement "the living room floor is rectangular" is an example of a(n)
. The length and width of the room are examples of
information, which you can obtain as
from the user.



Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
38
Examine the code shown below. This program prints
lines of text.
For n = 1 To 5
Print "Loop number " n
Next n

For n = 1 To 5
Print "Loop number " n
Next n
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
39
Describe the three elements of a problem statement. Provide examples within the context of the pizza problem.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
40
List steps that consumers can take to avoid vulnerabilities that exist in defective software code.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
41
Provide a ballpark figure for the number of lines of code in an operating system such as Windows 7.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
42
Create a diagram that shows how low-level and high-level languages relate to the five generations of computer languages.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
43
A(n)
is a set of application program or operating system functions that programmers can access from within the programs they create. (Hint: Use the acronym.)

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
44

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
45
A(n)
methodology focuses on flexible program development and specifications that evolve as a project progresses.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
46
The section of a program that contains a repetition control is sometimes referred to as an iteration or a(n) 

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
47
A(n)
is a set of steps for carrying out a task that programmers express in Structured English, pseudocode, or flowcharts.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
48
A selection control structure tells a computer what to do based on whether a condition is true or false, whereas a(n)
control structure can change the order in which program instructions are executed.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
49
The sample code for the object-oriented pizza program in this section of the chapter was written using the
programming language.

Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck