Question 1. In the following list: John, Kate, Fred, Mark, Jon, Adam, Drew which
ID: 3685054 • Letter: Q
Question
Question
1. In the following list: John, Kate, Fred, Mark, Jon, Adam, Drew which element is the tail of the list?
a. John
b. Mark
c. Drew
d. Adam
2. Which of the following is a common iterator operation that moves an iterator to the next item in the list?
a. ++
b. --
c. *
d. +
3. ______ is the ability of a class to derive properties from a previously defined class.
a. Encapsulation
b. Simulation
c. Inheritance
d. Polymorphism
4. The specifications of an ADT's operations indicate ______.
a. what the operations do
b. how to implement the operations
c. how to store the data in the ADT
d. how to carry out the operations
5. In the following list: John, Kate, Fred, Mark, Jon, Adam, Drew which element does not have a predecessor?
a. John
b. Mark
c. Drew
d. Kate
6. A ______ method is one that a derived class can override.
a. final
b. base
c. static
d. virtual
7. Public inheritance should only be used when a(n) ______ relationship exists between the superclass and the subclass.
a. is-a
b. has-a
c. as-a
d. was-a
8. A subclass can contain its own version of an inherited method.
a. True
b. False
9. The insertion operation of the ADT list can insert new items ______.
a. only at the front of the list
b. only at the end of the list
c. only in the middle of the list
d. into any position of the list
10. Which of the following class declarations indicates that Ball is a derived class of Sphere?
a. class Sphere: public Ball
b. class Ball: public Sphere
c. class Ball::Sphere
d. class Ball(Sphere)
11. A derived class in C++ can have more than one base class.
a. True
b. False
12. In ______ inheritance, public and protected members of the base class are private members of the derived class.
a. private
b. public
c. conditional
d. protected
13. ______ enables the reuse of existing classes.
a. Encapsulation
b. Inheritance
c. Polymorphism
d. Simulation
14. A class's ______ members can only be used by its own methods and friends.
a. public
b. protected
c. private
d. final
15. A(n) ______ allows two modules to communicate with each other.
a. data structure
b. axiom
c. interface
d. client
16. A subclass inherits all of the following members of its superclass EXCEPT ______.
a. protected methods
b. constructors and destructor
c. data fields
d. public methods
17. A class template can have more than one data-type parameter.
a. True
b. False
18. ______ members of a class can be used only by methods and friends of both the class and any derived class.
a. Private
b. Primitive
c. Protected
d. Public
19. Which of the following declares a list of characters using a class template?
a. char <List> charList;
b. List <char> charList;
c. List <T> charList;
d. List(char) <T> charList;
20. The items in the ADT list are referenced by ______.
a. name
b. value
c. position number
d. position name
Explanation / Answer
1) c
2) a
3) c
4) a
5) a
6) c
7) a
8) True
9) d
10) b
11) True
12) a
13) b
14) c
15) c
16) b
17) True
18 c
19) b
20) c
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.