Deck 10: Classes and Object-Oriented Programming
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/38
العب
ملء الشاشة (f)
Deck 10: Classes and Object-Oriented Programming
1
Object-oriented programming allows us to hide the object's data attributes from code that is outside the object.
True
2
Which section in the UML holds the list of the class's methods?
A) first section
B) second section
C) third section
D) fourth section
A) first section
B) second section
C) third section
D) fourth section
C
3
Procedures operate on data items that are separate from the procedures.
True
4
The self parameter need not be named self but it is strongly recommended to do so,to conform with standard practice.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which method is automatically called when you pass an object as an argument to the print function?
A) __state__
B) __obj__
C) __str__
D) __init__
A) __state__
B) __obj__
C) __str__
D) __init__
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which method is automatically executed when an instance of a class is created in memory?
A) __state__
B) __obj__
C) __str__
D) __init__
A) __state__
B) __obj__
C) __str__
D) __init__
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
7
All class definitions are stored in the library so that they can be imported into any program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
8
All instances of a class share the same values of the data attributes in the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
9
A class can be thought of as a blueprint that can be used to create an object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
10
What type of method provides a safe way for code outside a class to retrieve the values of attributes,without exposing the attributes in a way that could allow them to be changed by code outside the method?
A) accessor
B) mutator
C) setter
D) class
A) accessor
B) mutator
C) setter
D) class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which section in the UML holds the list of the class's data attributes?
A) first section
B) second section
C) third section
D) fourth section
A) first section
B) second section
C) third section
D) fourth section
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
12
A mutator method has no control over the way that a class's data attributes are modified.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which attributes belong to a specific instance of a class?
A) instance
B) self
C) object
D) data
A) instance
B) self
C) object
D) data
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
14
What is the special name given to the method that returns a string containing an object's state?
A) __state__
B) __obj__
C) __str__
D) __init__
A) __state__
B) __obj__
C) __str__
D) __init__
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
15
What does the acronym UML stand for?
A) Unified Modeling Language
B) United Modeling Language
C) Unified Model Language
D) Union of Modeling Languages
A) Unified Modeling Language
B) United Modeling Language
C) Unified Model Language
D) Union of Modeling Languages
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
16
What type of programming contains class definitions?
A) procedural
B) top-down
C) object-oriented
D) modular
A) procedural
B) top-down
C) object-oriented
D) modular
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
17
In a UML diagram the first section holds the list of the class's methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
18
The procedures that an object performs are called
A) methods
B) actions
C) modules
D) instances
A) methods
B) actions
C) modules
D) instances
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
19
The self parameter is required in every method of a class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
20
An object is a stand-alone program but is used by programs that need its service.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of the following can be thought of as a self-contained unit that consists of data attributes and the methods that operate on the data attributes?
A) a class
B) an object
C) an instance
D) a module
A) a class
B) an object
C) an instance
D) a module
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
22
The instance attributes are created by the __________ parameter and they belong to a specific instance of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
23
In object-oriented programming,one of first tasks of the programmer is to
A) list the nouns in the problem
B) list the methods that are needed
C) identify the classes needed
D) identify the objects needed
A) list the nouns in the problem
B) list the methods that are needed
C) identify the classes needed
D) identify the objects needed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
24
Mutator methods are also known as
A) setters
B) getters
C) instances
D) attributes
A) setters
B) getters
C) instances
D) attributes
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
25
In ___________ programming,the programming is centered on objects that are created from abstract data types that encapsulate data and functions together.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
26
Combining data and code in a single object is known as
A) modularity
B) instantiation
C) encapsulation
D) objectification
A) modularity
B) instantiation
C) encapsulation
D) objectification
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
27
A class __________ is a set of statements that defines a class's methods and data attributes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
28
An object's __________ contains the values of the object's attributes at a given moment.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
29
Each object that is created from a class is called a(n)__________ of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
30
___________ provides a set of standard diagrams for graphically depicting object-oriented systems.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
31
When an object is passed as an argument,__________ is passed into the parameter variable.
A) a copy of the object
B) a reference to the object's state
C) a reference to the object
D) Objects cannot be passed as arguments.
A) a copy of the object
B) a reference to the object's state
C) a reference to the object
D) Objects cannot be passed as arguments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
32
A method that returns a value from a class's attribute but does not change it is known as a(n)__________ method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
33
___________ programming is a method of writing software that centers on the actions that take place in a program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
34
A(n)__________ method in a class initializes an object's data attributes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which is the first line needed when creating a class named Worker?
A) def__init__(self):
B) class Worker:
C) import random
D) def worker_pay(self):
A) def__init__(self):
B) class Worker:
C) import random
D) def worker_pay(self):
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
36
Accessor methods are also known as
A) setters
B) getters
C) instances
D) attributes
A) setters
B) getters
C) instances
D) attributes
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
37
A(n)__________ is code that specifies the data attributes and methods for a particular type of object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
38
Which of the following will create an object,worker_joey,of the Worker class?
A) def__init__(worker_joey):
B) class worker_joey:
C) worker_joey = Worker()
D) worker_joey.Worker
A) def__init__(worker_joey):
B) class worker_joey:
C) worker_joey = Worker()
D) worker_joey.Worker
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck