hello quizlet
Home
Subjects
Expert solutions
Create
Study sets, textbooks, questions
Log in
Sign up
Upgrade to remove ads
Only $35.99/year
M7: Quiz
Flashcards
Learn
Test
Match
Flashcards
Learn
Test
Match
Terms in this set (15)
The semantics of multiple inheritance becomes complex and error prone, if the base classes have
a) members with different names.
b) variables using different types of memory.
c) overlapped members.
d) variable using the same type of memory.
c) overlapped members.
If a class needs to inherit from multiple parent classes, the parent classes must
a) be inherited as virtual classes.
b) contain virtual functions only.
c) be defined as interface classes only.
d) not contain overlapped members.
a) be inherited as virtual classes.
If A is the base class and B is a class derived from A, and x and y are pointers to objects of A and B, respectively, which assignment statement can pass the compiler check?
a) x = y;
b) y = x;
c) A = B;
d) B = A;
a) x = y;
What type of values can a throw-statement throw (return)?
a) Primitive type.
b) String type.
c) Object types.
d) All of the above.
d) All of the above.
If you want to create a linked list of Container nodes, which can contain Publication node, Book node, Thesis node, and Report node, what type of pointer should be declared in the Container to point to all these nodes?
a) A pointer to Book node
b) A pointer to Publication node
c) A pointer to Report node
d) A pointer to Thesis node
b) A pointer to Publication node
If the relation between two C++ classes can be best described as "is-a" relation, we should
a) derive one class from the other (inheritance).
b) contain one class in the other (containment).
c) define them to be independent of each other.
d) merge them into a single class.
a) derive one class from the other (inheritance).
If you declare a pointer to the object of the parent class and use the pointer to access the object of a child class, you can access
a) all the members of the child class.
b) the members that exist in the parent class.
c) the members that do not exist in the parent class.
d) none of the members.
b) the members that exist in the parent class.
Given the following class definition and the variable declaration:
class employee {
public:
char *name;
long id;
};
class manager {
public:
employee empl;
char* rank;
} x;
Which of the following assignment statement is correct?
a) x.id = 12345;
b) x.empl.id = 12345;
c) x->id = 12345;
d) x.empl->id = 12345;
b) x.empl.id = 12345;
What type casting mechanism should be used if you want to cast an integer value to a double value?
a) static_cast
b) const_cast
c) dynamic_cast
d) reinterpret_cast
a) static_cast
What type casting mechanism should be used if you want to safely change (cast) a pointer type for pointing to a different object in an inheritance hierarchy?
a) static_cast
b) const_cast
c) dynamic_cast
d) reinterpret_cast
c) dynamic_cast
Consider C++'s typing system. C++ uses (Select all correct answers)
a) value semantics for its primitive types (such as integer and float) only.
b) both value semantics and reference semantics for its primitive types.
c) reference semantics for its object types only.
d) both value semantics and reference semantics for its object types.
b) both value semantics and reference semantics for its primitive types .
d) both value semantics and reference semantics for its object types.
Consider Java's typing system. Java uses (Select all correct answers)
a) value semantics for its primitive types (such as integer and float) only.
b) both value semantics and reference semantics for its primitive types.
c) reference semantics for its object types only.
d) both value semantics and reference semantics for its object types.
a) value semantics for its primitive types (such as integer and float) only.
c) reference semantics for its object types only.
Given the following snippet of C++ code:
string name = "Hello";
ifstream myFile;
myFile.open("data.txt");
myFile >> name;
myFile.close();
What does it do?
a) It saves the word Hello into a file in the file system.
b) It loads the word Hello from a file in the file system.
c) It prints the word Hello to screen (standard output).
d) It reads a word from the keyboard (standard input).
b) It loads the word Hello from a file in the file system.
What keyword is used for defining an exception handler?
a) catch
b) throw
c) try
d) return
a) catch
A throw statement is associated with a specific exception handler through the
a) handler name.
b) throw value.
c) try value.
d) the data type implied by the throw value.
d) the data type implied by the throw value.
Sets found in the same folder
M4: Quiz
15 terms
M3: Quiz
15 terms
M2: Quiz
15 terms
M5: Quiz
15 terms
Other sets by this creator
M9: Quiz
13 terms
M9: Quiz
13 terms
M9: Quiz
13 terms
M9: Quiz
13 terms
Verified questions
chemistry
Use the periodic table and the information that follows to write the hyphen notation for each isotope described. a. atomic number = 2, mass number = 4 b. atomic number = 8, mass number = 16 c. atomic number = 19, mass number = 39
physics
Vector $\vec{A}$ has magnitude $3.0 \mathrm{~m}$ and points to the right; vector $\vec{B}$ has magnitude $4.0 \mathrm{~m}$ and points vertically upward. Find the magnitude and direction of vector $\vec{C}$ such that $\vec{A}+\vec{B}+\vec{C}=\overrightarrow{0}$.
biology
We frequently must solve equations of the form f(x) = 0. When f is a continuous function on [a, b] and f(a) and f(b) have opposite signs, the intermediate-value theorem guarantees that there exists at least one solution of the equation f(x) = 0 in [a, b]. (a) Explain in words why there exists exactly one solution in (a, b) if, in addition, f is differentiable in (a, b) and $f^{\prime}(x)<0$ is either strictly positive or strictly negative throughout (a, b). (b) Use the result in (a) to show that $x^{3}-4 x+1=0$ has exactly one solution in [−1, 1].
earth science
In the subtropics, why are the surface salinities much higher than the deep-water salinities?
Other Quizlet sets
MARKETING
18 terms
Hw question
24 terms
PowerPoint 1,2 and 3
53 terms
bio 32 study hw exam 3
60 terms