Deck 3: C++ Programming Concepts

ملء الشاشة (f)
exit full mode
سؤال
Empty parentheses following a function name in a function prototype indicate that the function does not require any parameters to perform its task.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
C++ programmers concentrate on creating , which contain data members and the member functions that manipulate those data members and provide services to clients.

A)structures
B)classes
C)objects
D)function
سؤال
Which of the following is FALSE about references in C++

A)a reference must be initialized when declared
B)once a reference is created, it cannot be later made to reference another object; it cannot be reset
C)references cannot be null
D)references cannot refer to constant value
سؤال
What will be the output of following program?#include <iostream> using namespace std;class Test{public:Test() { cout <<"Hello from Test() "; }} a;int main(){cout <<"Main Started "; return 0;}

A)main started
B)main started hello from test()
C)hello from test() main started
D)compiler error: global objects are not allowed
سؤال
Which of the following is true about constructors.
1) They cannot be virtual.
2) They cannot be private.
3) They are automatically called by new operator

A)all 1, 2, and 3
B)only 1 and 3
C)only 1 and 2
D)only 2 and 3
سؤال
Which of the following operators are overloaded by default by the compiler?
1) Comparison Operator ( == )
2) Assignment Operator ( = )

A)both 1 and 2
B)only 1
C)only 2
D)none of the two
سؤال
Which of the following is true about inline functions and macros.

A)inline functions do type checking for parameters, macros don't
B)macros cannot have return statement, inline functions can
C)macros are processed by pre-processor and inline functions are processed in later stages of compilation.
D)all of the above
سؤال
In C++, const qualifier can be applied to?Member functions of a class?Function arguments?To a class data member which is declared as static?Reference variables

A)only 1, 2 and 3
B)only 1, 2 and 4
C)all of the above
D)only 1, 3 and 4
سؤال
Which type is best suited to represent the logical values?

A)integer
B)boolean
C)character
D)all of the mentioned
سؤال
The following is the C++ style comment

A)//
B)/*..*/
C)-
D)none of above
سؤال
Which of the following statements is false?

A)every c++ program must have a main().
B)in c++, white spaces and carriage returns are ignored by the compiler.
C)c++ statements terminate with semicolon.
D)main() terminates with semicolon.
سؤال
Functions can returns

A)arrays
B)references
C)objects
D)all of above
سؤال
Which of the following control expressions are valid for an if statement?

A)an integer expression
B)a boolean expression
C)either a or b
D)neither a nor b
سؤال
What will be the values of x, m and n after execution of the following statements? Int x, m, n;m=10; n=15;x= ++m + n++;

A)x=25, m=10, n=15
B)x=27, m=10, n=15
C)x=26, m=11, n=16
D)x=27, m=11, n=16
سؤال
Which of the following approach is adapted by C++?

A)top-down
B)bottom-up
C)right-left
D)left-right
سؤال
Which of the following is the correct class of the object cout?

A)iostream
B)istream
C)ostream
D)ifstream
سؤال
Which of the following functions are performed by a constructor?

A)construct a new class
B)construct a new object
C)construct a new function
D)initialize objects
سؤال
Which of the following ways are legal to access a class data member using this pointer?

A)this->x
B)this.x
C)*this.x
D)*this-x
سؤال
Which operator is having right to left associativity in the following?

A)array subscripting
B)function call
C)addition and subtraction
D)type cast
سؤال
Which operator is having the highest precedence?

A)postfix
B)unary
C)shift
D)equality
سؤال
#include <iostream> using namespace std; int main(){int a;a = 5 + 3 * 5;cout <<a; return 0;}

A)35
B)20
C)25
D)30
سؤال
In procedural programming the focus in on …...........

A)data
B)structure
C)function
D)pointers
سؤال
In object oriented programming the focus is on ….......

A)data
B)structure
C)function
D)pointers
سؤال
Which of the following feature of procedure oriented program is false?

A)makes use of bottom up approach
B)functions share global data
C)the most fundamental unit of program is function
D)all of these
سؤال
Which of the following feature of object oriented program is false?

A)data and functions can be added easily
B)data can be hidden from outside world
C)object can communicate with each other
D)the focus is on procedures
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/25
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 3: C++ Programming Concepts
1
Empty parentheses following a function name in a function prototype indicate that the function does not require any parameters to perform its task.
True
2
C++ programmers concentrate on creating , which contain data members and the member functions that manipulate those data members and provide services to clients.

A)structures
B)classes
C)objects
D)function
classes
3
Which of the following is FALSE about references in C++

A)a reference must be initialized when declared
B)once a reference is created, it cannot be later made to reference another object; it cannot be reset
C)references cannot be null
D)references cannot refer to constant value
references cannot refer to constant value
4
What will be the output of following program?#include <iostream> using namespace std;class Test{public:Test() { cout <<"Hello from Test() "; }} a;int main(){cout <<"Main Started "; return 0;}

A)main started
B)main started hello from test()
C)hello from test() main started
D)compiler error: global objects are not allowed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of the following is true about constructors.
1) They cannot be virtual.
2) They cannot be private.
3) They are automatically called by new operator

A)all 1, 2, and 3
B)only 1 and 3
C)only 1 and 2
D)only 2 and 3
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which of the following operators are overloaded by default by the compiler?
1) Comparison Operator ( == )
2) Assignment Operator ( = )

A)both 1 and 2
B)only 1
C)only 2
D)none of the two
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which of the following is true about inline functions and macros.

A)inline functions do type checking for parameters, macros don't
B)macros cannot have return statement, inline functions can
C)macros are processed by pre-processor and inline functions are processed in later stages of compilation.
D)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
8
In C++, const qualifier can be applied to?Member functions of a class?Function arguments?To a class data member which is declared as static?Reference variables

A)only 1, 2 and 3
B)only 1, 2 and 4
C)all of the above
D)only 1, 3 and 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
9
Which type is best suited to represent the logical values?

A)integer
B)boolean
C)character
D)all of the mentioned
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
10
The following is the C++ style comment

A)//
B)/*..*/
C)-
D)none of above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of the following statements is false?

A)every c++ program must have a main().
B)in c++, white spaces and carriage returns are ignored by the compiler.
C)c++ statements terminate with semicolon.
D)main() terminates with semicolon.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
12
Functions can returns

A)arrays
B)references
C)objects
D)all of above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which of the following control expressions are valid for an if statement?

A)an integer expression
B)a boolean expression
C)either a or b
D)neither a nor b
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
14
What will be the values of x, m and n after execution of the following statements? Int x, m, n;m=10; n=15;x= ++m + n++;

A)x=25, m=10, n=15
B)x=27, m=10, n=15
C)x=26, m=11, n=16
D)x=27, m=11, n=16
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
15
Which of the following approach is adapted by C++?

A)top-down
B)bottom-up
C)right-left
D)left-right
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
16
Which of the following is the correct class of the object cout?

A)iostream
B)istream
C)ostream
D)ifstream
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
17
Which of the following functions are performed by a constructor?

A)construct a new class
B)construct a new object
C)construct a new function
D)initialize objects
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
18
Which of the following ways are legal to access a class data member using this pointer?

A)this->x
B)this.x
C)*this.x
D)*this-x
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which operator is having right to left associativity in the following?

A)array subscripting
B)function call
C)addition and subtraction
D)type cast
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which operator is having the highest precedence?

A)postfix
B)unary
C)shift
D)equality
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
21
#include <iostream> using namespace std; int main(){int a;a = 5 + 3 * 5;cout <<a; return 0;}

A)35
B)20
C)25
D)30
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
22
In procedural programming the focus in on …...........

A)data
B)structure
C)function
D)pointers
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
23
In object oriented programming the focus is on ….......

A)data
B)structure
C)function
D)pointers
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which of the following feature of procedure oriented program is false?

A)makes use of bottom up approach
B)functions share global data
C)the most fundamental unit of program is function
D)all of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
25
Which of the following feature of object oriented program is false?

A)data and functions can be added easily
B)data can be hidden from outside world
C)object can communicate with each other
D)the focus is on procedures
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.