Deck 1: C++ Class and Function Fundamentals
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/21
العب
ملء الشاشة (f)
Deck 1: C++ Class and Function Fundamentals
1
Every class has at least one constructor function, even when none is declared.
True
2
What is the difference between struct and class in terms of Access Modifier?
A)by default all the struct members are private while by default class members are public.
B)by default all the struct members are protected while by default class members are private.
C)by default all the struct members are public while by default class members are private.
D)by default all the struct members are public while by default class members are protected.
A)by default all the struct members are private while by default class members are public.
B)by default all the struct members are protected while by default class members are private.
C)by default all the struct members are public while by default class members are private.
D)by default all the struct members are public while by default class members are protected.
by default all the struct members are public while by default class members are private.
3
The default access level assigned to members of a class is
A)private
B)public
C)protected
D)needs to be assigned
A)private
B)public
C)protected
D)needs to be assigned
private
4
There is nothing like a virtual constructor of a class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of the following operators allow defining the member functions of a class outside the class?
A)(::)
B)(?)
C)(:?)
D)(%)
A)(::)
B)(?)
C)(:?)
D)(%)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which type of class has only one unique value for all the objects of that same class?
A)this
B)friend
C)static
D)both a and b
A)this
B)friend
C)static
D)both a and b
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
7
What is a constructor?
A)a class automatically called whenever a new object of this class is created.
B)a class automatically called whenever a new object of this class is destroyed.
C)a function automatically called whenever a new object of this class is created.
D)a function automatically called whenever a new object of this class is destroyed.
A)a class automatically called whenever a new object of this class is created.
B)a class automatically called whenever a new object of this class is destroyed.
C)a function automatically called whenever a new object of this class is created.
D)a function automatically called whenever a new object of this class is destroyed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
8
Under what conditions a destructor destroys an object?
A)scope of existence has finished
B)object dynamically assigned and it is released using the operator delete.
C)program terminated.
D)both a and b.
A)scope of existence has finished
B)object dynamically assigned and it is released using the operator delete.
C)program terminated.
D)both a and b.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
9
When class B is inherited from class A, what is the order in which the constructers of those classes are called
A)class a first class b next
B)class b first class a next
C)class b's only as it is the child class
D)class a's only as it is the parent class
A)class a first class b next
B)class b first class a next
C)class b's only as it is the child class
D)class a's only as it is the parent class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
10
Which one of the following is not a valid reserved keyword in C++?
A)explicit
B)public
C)implicit
D)private
A)explicit
B)public
C)implicit
D)private
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
11
Variables declared in the body of a particular member function are known as data members and can be used in all member functions of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
12
In a class definition, data or functions designated private are accessible
A)to any function in the program.
B)only if you know the password.
C)to member functions of that class.
D)only to public members of the class.
A)to any function in the program.
B)only if you know the password.
C)to member functions of that class.
D)only to public members of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
13
A member function can always access the data
A)in the object of which it is a member.
B)in the class of which it is a member.
C)in any object of the class of which it is a member.
D)in the public part of its class.
A)in the object of which it is a member.
B)in the class of which it is a member.
C)in any object of the class of which it is a member.
D)in the public part of its class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
14
Classes are useful because they
A)can closely model objects in the real world.
B)permit data to be hidden from other classes.
C)bring together all aspects of an entity in one place.
D)options a, b and c
A)can closely model objects in the real world.
B)permit data to be hidden from other classes.
C)bring together all aspects of an entity in one place.
D)options a, b and c
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
15
For the object for which it was called, a const member function
A)can modify both const and non-const member data.
B)can modify only const member data.
C)can modify only non-const member data.
D)can modify neither const nor non-const member data.
A)can modify both const and non-const member data.
B)can modify only const member data.
C)can modify only non-const member data.
D)can modify neither const nor non-const member data.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
16
Dividing a program into functions
A)is the key to object-oriented programming.
B)makes the program easier to conceptualize.
C)may reduce the size of the program.
D)option b and c
A)is the key to object-oriented programming.
B)makes the program easier to conceptualize.
C)may reduce the size of the program.
D)option b and c
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
17
An expression
A)usually evaluates to a numerical value.
B)may be part of a statement.
C)always occurs outside a function.
D)option a and b
A)usually evaluates to a numerical value.
B)may be part of a statement.
C)always occurs outside a function.
D)option a and b
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
18
A variable of type char can hold the value 301.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
19
It's perfectly all right to use variables of different data types in the same arithmetic expression.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
20
A function's single most important role is to
A)give a name to a block of code.
B)reduce program size.
C)accept arguments and provide a return value.
D)help organize a program into conceptual units.
A)give a name to a block of code.
B)reduce program size.
C)accept arguments and provide a return value.
D)help organize a program into conceptual units.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
21
A function argument is
A)a variable in the function that receives a value from the calling program.
B)a way that functions resist accepting the calling program's values.
C)a value sent to the function by the calling program.
D)a value returned by the function to the calling program.
A)a variable in the function that receives a value from the calling program.
B)a way that functions resist accepting the calling program's values.
C)a value sent to the function by the calling program.
D)a value returned by the function to the calling program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck