Deck 12: Separate Compilation and Namespaces

ملء الشاشة (f)
exit full mode
سؤال
The statement using namespace std is called _______________.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
In the implementation file for a class name myClass,you have the following statement:
void myClass::display)
{
//code here
}
What does the :: mean here?
سؤال
The statement using namespace std and the statement using std::cin are the same.
سؤال
In order to make a user-defined ADT available that is defined in the file myfile.h,you would

A)#include
B)#include myfile.h
C)#include
D)#include "myfile.h"
سؤال
In the statement std::cin,what does the :: mean?
سؤال
You may not use multiple namespaces in the same program.
سؤال
The statement using std::cin is called a ______________
سؤال
The file that contains the main portion of your program is called

A)the implementation file
B)the interface file
C)the application file
D)the specification file
سؤال
The unspecified namespace is named _________.
سؤال
The file that contains the definition of the class is called the _____________
سؤال
ADTs should be defined and implemented in separate files
سؤال
The global namespace and the unnamed namespace are the same.
سؤال
If a name is defined in an unnamed namespace in a different compilation unit,it may not be accessed outside of that compilation unit.
سؤال
Classes must always be defined in separate files
سؤال
cin and cout are part of the ________________ namespace.
سؤال
Names that are defined outside of a namespace are part of the unnamed namespace
سؤال
All code is in some namespace.
سؤال
The file that contains the definitions of the member functions of a class is called the ________________
سؤال
In a program with no user defined namespaces,all names are defined in the global namespace
سؤال
All names are defined in some namespace
سؤال
If you have a class defined in separate files,and change the way a member function is defined the body of the function),which files need to be re-compiled?

A)The interface
B)The application
C)The Implementation
D)All files
E)B and C
سؤال
We use the #ifndef,#define,and #endif

A)to prevent multiple definitions of a class
B)when we use separate files
C)whenever we use a class
D)none of the above
E)A and B
سؤال
Why will the following code not compile?
Namespace ns1
{
Void print);
Void display1){};
}
Namespace ns2
{
Void print);
Void display2){};
}
Int main)
{
Using namespace ns1;
Using namespace ns2;
Display1);
Display2);
Print);
Return 0;
}

A)The call to print is ambiguous
B)We have not included the iostream library
C)We have not used namespace std
D)It will compile
سؤال
Which file name will end in a .cpp?

A)Implementation File
B)Application File
C)All input files
D)Interface File
E)A and B
سؤال
In order to create a namespace called student,you use

A)namespace student {
//code goes here
}
B){ namespace student
//code goes here
}
C)student namespace {
//code goes here
}
D){ student namespace
//code goes here
}
سؤال
The identifier used in the #ifndef directive should be

A)the name of the class in upper case letters
B)Your name in upper case letters
C)The file name in uppercase letters with an _ instead of a .)
D)whatever you want it to be
سؤال
Which file name will end in a .h?

A)Implementation
B)Application
C)All input files
D)Interface File
E)A and B
سؤال
In order to hide functions that are defined in the implementation file,they should be part of the ______________ namespace.

A)global
B)std
C)class
D)unnamed
سؤال
If you want to only use cin and cout but no other names)from the std namespace,you would

A)using std::cin; using std::cout;
B)not be able to do it.
C)cin and cout are not in the std namespace
D)always have to say std::cin and std::cout
E)Either A or D
سؤال
cin and cout are defined in the _________ namespace

A)iostream
B)std
C)standard
D)global
سؤال
All the code between
#ifndef MYCLASS_H
And
#endf
Is ____________ if MYCLASS_H is defined.

A)skipped
B)executed
C)compiled
D)debugged
سؤال
Connecting the application and implementation files together to form an executable file is called

A)compiling
B)assembling
C)linking
D)debugging
سؤال
If you have a class defined in separate files,and change the main program,which files need to be re-compiled?

A)The interface
B)The application
C)The Implementation
D)All files
E)B and C
سؤال
What is the difference between an ADT and a class in C++?

A)In an ADT,the user does not have access to the implementation details
B)In an ADT,the user can change the implementation details
C)There is no difference
D)A class must always be in a separate file
سؤال
A namespace is

A)a collection of name definitions
B)using std
C)used to distinguish between identical names
D)All of the above
E)A and C
سؤال
If you have a class defined in separate files,and change the way a class is defined,which files need to be re-compiled?

A)The interface
B)The application
C)The Implementation
D)All files
E)B and C
سؤال
A using directive that is at the start of the file

A)Is a syntax error
B)Applies to the entire file
C)Applies only to the first block
D)Hides all other namespace directives
سؤال
A using directive that appears inside a set of braces applies

A)Only to that block
B)From that point to the end of the file
C)Everywhere
D)Only if the namespace is std
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/38
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 12: Separate Compilation and Namespaces
1
The statement using namespace std is called _______________.
a using directive
2
In the implementation file for a class name myClass,you have the following statement:
void myClass::display)
{
//code here
}
What does the :: mean here?
that display is part of the class myClass
3
The statement using namespace std and the statement using std::cin are the same.
False
4
In order to make a user-defined ADT available that is defined in the file myfile.h,you would

A)#include
B)#include myfile.h
C)#include
D)#include "myfile.h"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
5
In the statement std::cin,what does the :: mean?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
6
You may not use multiple namespaces in the same program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
7
The statement using std::cin is called a ______________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
8
The file that contains the main portion of your program is called

A)the implementation file
B)the interface file
C)the application file
D)the specification file
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
9
The unspecified namespace is named _________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
10
The file that contains the definition of the class is called the _____________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
11
ADTs should be defined and implemented in separate files
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
12
The global namespace and the unnamed namespace are the same.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
13
If a name is defined in an unnamed namespace in a different compilation unit,it may not be accessed outside of that compilation unit.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
14
Classes must always be defined in separate files
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
15
cin and cout are part of the ________________ namespace.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
16
Names that are defined outside of a namespace are part of the unnamed namespace
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
17
All code is in some namespace.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
18
The file that contains the definitions of the member functions of a class is called the ________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
19
In a program with no user defined namespaces,all names are defined in the global namespace
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
20
All names are defined in some namespace
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
21
If you have a class defined in separate files,and change the way a member function is defined the body of the function),which files need to be re-compiled?

A)The interface
B)The application
C)The Implementation
D)All files
E)B and C
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
22
We use the #ifndef,#define,and #endif

A)to prevent multiple definitions of a class
B)when we use separate files
C)whenever we use a class
D)none of the above
E)A and B
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
23
Why will the following code not compile?
Namespace ns1
{
Void print);
Void display1){};
}
Namespace ns2
{
Void print);
Void display2){};
}
Int main)
{
Using namespace ns1;
Using namespace ns2;
Display1);
Display2);
Print);
Return 0;
}

A)The call to print is ambiguous
B)We have not included the iostream library
C)We have not used namespace std
D)It will compile
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which file name will end in a .cpp?

A)Implementation File
B)Application File
C)All input files
D)Interface File
E)A and B
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
25
In order to create a namespace called student,you use

A)namespace student {
//code goes here
}
B){ namespace student
//code goes here
}
C)student namespace {
//code goes here
}
D){ student namespace
//code goes here
}
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
26
The identifier used in the #ifndef directive should be

A)the name of the class in upper case letters
B)Your name in upper case letters
C)The file name in uppercase letters with an _ instead of a .)
D)whatever you want it to be
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which file name will end in a .h?

A)Implementation
B)Application
C)All input files
D)Interface File
E)A and B
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
28
In order to hide functions that are defined in the implementation file,they should be part of the ______________ namespace.

A)global
B)std
C)class
D)unnamed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
29
If you want to only use cin and cout but no other names)from the std namespace,you would

A)using std::cin; using std::cout;
B)not be able to do it.
C)cin and cout are not in the std namespace
D)always have to say std::cin and std::cout
E)Either A or D
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
30
cin and cout are defined in the _________ namespace

A)iostream
B)std
C)standard
D)global
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
31
All the code between
#ifndef MYCLASS_H
And
#endf
Is ____________ if MYCLASS_H is defined.

A)skipped
B)executed
C)compiled
D)debugged
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
32
Connecting the application and implementation files together to form an executable file is called

A)compiling
B)assembling
C)linking
D)debugging
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
33
If you have a class defined in separate files,and change the main program,which files need to be re-compiled?

A)The interface
B)The application
C)The Implementation
D)All files
E)B and C
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
34
What is the difference between an ADT and a class in C++?

A)In an ADT,the user does not have access to the implementation details
B)In an ADT,the user can change the implementation details
C)There is no difference
D)A class must always be in a separate file
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
35
A namespace is

A)a collection of name definitions
B)using std
C)used to distinguish between identical names
D)All of the above
E)A and C
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
36
If you have a class defined in separate files,and change the way a class is defined,which files need to be re-compiled?

A)The interface
B)The application
C)The Implementation
D)All files
E)B and C
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
37
A using directive that is at the start of the file

A)Is a syntax error
B)Applies to the entire file
C)Applies only to the first block
D)Hides all other namespace directives
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
38
A using directive that appears inside a set of braces applies

A)Only to that block
B)From that point to the end of the file
C)Everywhere
D)Only if the namespace is std
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 38 في هذه المجموعة.