In: Computer Science
1. From the statement “Lincoln is the 16th US president”, we can come up with the following designs. Which one is most appropriate?
a. Two independent Classes: Lincon and President.
b. Two Classes: Lincon and President, with Lincon subclass of President.
c. A class President, with Lincon being an object of the class President.
d. None of the above.
4.An advantage of inheritance is that
a. All methods in a super class can be inherited by its subclasses.
b. All instance variables in a super class can be accessed by subclasses.
c. An object of a subclass can be treated as an object of the superclass.
d. None of the above.
6. Pair programming refers to the style where two programmers switching their roles in coding and real-time reviewing. This encourages:
a. Collective code ownership
b. Cross-learning among peers
c. Code critics and refinement
d. All of the above
1. Choice(c) is correct, ie, A class President, with Lincon being an object of the class President.
2. Choice(c) is correct, ie., An object of a subclass can be treated as an object of the superclass.
3. Choice(D) is correct, ie., All of the above