1.Each and every class in a C++ program (by convention) are defined in how many
ID: 653450 • Letter: 1
Question
1.Each and every class in a C++ program (by convention) are defined in how many files?
In other words, if you have a project and add a new class for it, how many files will you have to add?
2. Which of the following goes into a header file when you write a class?
Select one:
a. the class specification
b. scope
c. implementation
d. warnings
e. objects
f. function definitions
g. class function definitions
h. void
3. :: is a scope operator that you use to designate which class a function/method belong to.
Select one:
True
False
4.Hoa many bytes of memory is set aside/reserved by the following class declaration? (enter a number, 0-1000)
Select one or more:
a. the class's header file
b. all other header files that use the class
c. the class's cpp file
d. always in main.cpp
e. all cpp files that use the class
f. all other cpp files
g. none of the above
h. all other header files
6. which of the following goes into a header file when you write a class?
Select one:
a. the class specification
b. scope
c. implementation
d. warnings
e. objects
f. function definitions
g. class function definitions
h. void
Explanation / Answer
1. Each and every class in a C++ program (by convention) are defined in how many files?
Answer: 2(.h and .cpp files)
2. Which of the following goes into a header file when you write a class?
Answer: a. the class specification(consists of the class variables, methods, friends function names etc).
3. :: is a scope operator that you use to designate which class a function/method belong to.
Answer: True
4. Hoa many bytes of memory is set aside/reserved by the following class declaration? (enter a number, 0-1000)
Answer: 0
Reason: The definition of a class does not set aside any memory. Memory is set aside for variables of a class(objects) when they are declared.(If you are askking that, the answer would be 12(there are 3 int type variables in the class))
5. You have to #include a particular class's header file in which of the following files?
Answers:
b. all other header files that use the class
c. the class's cpp file
e. all cpp files that use the class
6. Question repeated(same as 2nd one)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.