Deck 12: Computer Programming
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/46
العب
ملء الشاشة (f)
Deck 12: Computer Programming
1
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.



Problem statement
It is a set of elements which are manipulated to get a desired result. Each problem statement has following features:
• It must depict necessary assumption which is necessary to determine the problem scope.
• It clearly depicts the information which is already known.
• The duration required to solves a problem.
An assumption is something which is accepted as true in order to solve a problem like assumption in a living room floor problem which is rectangular.
Known information is the information or input taken from the user about problem which is required in problem solving like living room floor problem in order to calculate the area of pizza, length and width is required.
Therefore, the appropriate words to fill in the blanks are assumption , known and input.
It is a set of elements which are manipulated to get a desired result. Each problem statement has following features:
• It must depict necessary assumption which is necessary to determine the problem scope.
• It clearly depicts the information which is already known.
• The duration required to solves a problem.
An assumption is something which is accepted as true in order to solve a problem like assumption in a living room floor problem which is rectangular.
Known information is the information or input taken from the user about problem which is required in problem solving like living room floor problem in order to calculate the area of pizza, length and width is required.
Therefore, the appropriate words to fill in the blanks are assumption , known and input.
2
Define the following terms associated with the declarative paradigm: fact, rule, predicate, arguments, goal, instantiation, and backtracking.
Declarative Programming
Declarative paradigm of programming deals with describing the problem without the exact specification of the way to arrive to solution. The different thing is that declarative programming focuses on describing aspects of a problem that helps to arrive to solution. There are several building blocks in any declarative programming paradigm. They are defined below:
1. Facts : A fact is the statement in which the basic information is supplied to the computer for solving a problem. For example in the program to calculate the sum of two even numbers, the fact is:
"Both the numbers are integers" and
"Both the numbers are even"
2. Rules : Rule describes the relationship between different facts. For example for above program the rule is:
"The remainder of the division (number/2) should be 0"
3. Predicate : When any fact is written there is a sentence in parentheses and a statement that is not parenthesized. This non parenthesized statement is known as predicate.
For example to specify that the numbers are even, the statement is:
Even (num1, num2)It is the predicate.
Predicate shows the relationship between the arguments.
4. Argument : Argument is the sentence which is written in the parenthesis like if the fact is written as "Both the numbers are integers", then the sentence in parenthesis is an argument of the fact.
5. Goal : The fact is considered as a record in the database. To access any required record from the database users write a query by asking a question. This query is known as Goal.
6. Instantiation : Taking value on a variable is known as instantiation. For example for running the above program user can instantiate 2 as a value in first variable. Then only two numbers could be added. Instantiation can be used to create information that is not contained by the database.
7. Backtracking : Any declarative language automatically runs over every possible instantiation. When instantiation is required to follow on more than one variable then it is viewed as backtracking.
For example for running the above program user can instantiate 2 as a value in first variable and 4 in other.
Declarative paradigm of programming deals with describing the problem without the exact specification of the way to arrive to solution. The different thing is that declarative programming focuses on describing aspects of a problem that helps to arrive to solution. There are several building blocks in any declarative programming paradigm. They are defined below:
1. Facts : A fact is the statement in which the basic information is supplied to the computer for solving a problem. For example in the program to calculate the sum of two even numbers, the fact is:
"Both the numbers are integers" and
"Both the numbers are even"
2. Rules : Rule describes the relationship between different facts. For example for above program the rule is:
"The remainder of the division (number/2) should be 0"
3. Predicate : When any fact is written there is a sentence in parentheses and a statement that is not parenthesized. This non parenthesized statement is known as predicate.
For example to specify that the numbers are even, the statement is:
Even (num1, num2)It is the predicate.
Predicate shows the relationship between the arguments.
4. Argument : Argument is the sentence which is written in the parenthesis like if the fact is written as "Both the numbers are integers", then the sentence in parenthesis is an argument of the fact.
5. Goal : The fact is considered as a record in the database. To access any required record from the database users write a query by asking a question. This query is known as Goal.
6. Instantiation : Taking value on a variable is known as instantiation. For example for running the above program user can instantiate 2 as a value in first variable. Then only two numbers could be added. Instantiation can be used to create information that is not contained by the database.
7. Backtracking : Any declarative language automatically runs over every possible instantiation. When instantiation is required to follow on more than one variable then it is viewed as backtracking.
For example for running the above program user can instantiate 2 as a value in first variable and 4 in other.
3
OO programmers often use
diagrams to plan the classes for a program. (Hint: Use the abbreviation.)

Plan classes for a program
Various planning tools are used for the planning of a computer program. Program planning tools include UML diagrams, decision tables, flow-chat etc. UML stands for (Unified Modeling Language) which is used as graphical tool. This tool is used by analysts for documenting the systems. UML diagram has many interrelated diagrams which displays the view of the system. To use UML diagram most popular technique used is RUP which stands for Rational Unified Process.
Therefore, the appropriate word to fill in the blank is UML.
Various planning tools are used for the planning of a computer program. Program planning tools include UML diagrams, decision tables, flow-chat etc. UML stands for (Unified Modeling Language) which is used as graphical tool. This tool is used by analysts for documenting the systems. UML diagram has many interrelated diagrams which displays the view of the system. To use UML diagram most popular technique used is RUP which stands for Rational Unified Process.
Therefore, the appropriate word to fill in the blank is UML.
4
Provide a ballpark figure for the number of lines of code in an operating system such as Windows 7.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
5
Write at least five Prolog facts that describe your relationships to members of your family.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
6
The process of passing certain characteristics from a superclass to a subclass is referred to as
.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
7
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"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
8
Describe how buffer overflows and verbose error messages make computer programs vulnerable to hackers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
9
In an OO program, getArea() would be called a(n)
.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
10
Describe how the jobs performed by computer programmers differ from the jobs performed by software engineers and systems analysts.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
11
Create a sentence outline for Section E that focuses on techniques for secure programming.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
12
The sample code for the object-oriented pizza program in this section of the chapter was written using the
programming language.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
13
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
14
List steps that consumers can take to avoid vulnerabilities that exist in defective software code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
15
The declarative programming paradigm focuses on describing a(n) , whereas the procedural paradigm focuses on algorithms that describe a(n)
.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
16
Create a diagram that shows how low-level and high-level languages relate to the five generations of computer languages.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
17

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
18
In the Prolog fact location(balcony,H1), balcony and H1 are
, whereas location is referred to as the
.


فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
19
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.



فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
20
Computer programming
include procedural, object-oriented, eventdriven, and declarative.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
21
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 ).


فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
22
Describe the differences between event-driven, procedural, object-oriented, and declarative paradigms. Provide at least one example of a language that supports each paradigm.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
23
A(n)
methodology focuses on flexible program development and specifications that evolve as a project progresses.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
24
Finding the value for a variable while solving a Prolog goal is called
.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
25
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).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
26
To find errors in a computer program, programmers can use a software tool called a(n)
.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
27
In a Prolog rule, the :- connecting symbol means
.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
28
Describe the three elements of a problem statement. Provide examples within the context of the pizza problem.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
29
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.)

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
30
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.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
31
List and describe three types of errors that are typically found when computer programs are tested.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
32
A(n)
is a set of steps for carrying out a task that programmers express in Structured English, pseudocode, or flowcharts.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
33
To prevent hackers from guessing the location of critical program elements, programmers can use a technique called
space randomization.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
34
List and describe at least eight tools other than programming languages that programmers use to create computer programs.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
35
COBOL, Fortran, and C are examples of programming languages used when working with the
paradigm.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
36

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
37
Define the term algorithm and explain how it relates to procedural programming.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
38
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.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
39

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
40
Create a flowchart, structured English, and pseudocode to express the algorithm for tying your shoes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
41
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?


فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
42

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
43
Give an example of a sequence control structure, a selection control structure, and a repetition control structure.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
44
The section of a program that contains a repetition control is sometimes referred to as an iteration or a(n)


فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
45
Define the following terms associated with object-oriented programming: object, class, superclass, subclass, attribute, message, method, inheritance, polymorphism, and encapsulation.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
46
In OO programming, a class is a template for a group of
with similar characteristics.

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck