Question

In: Computer Science

1. From the statement “Lincoln is the 16th US president”, we can come up with the...

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

Solutions

Expert Solution

1. Choice(c) is correct, ie, A class President, with Lincon being an object of the class President.

  • President being a position and lincon can just hold that position for some years. So, a class is sort of having a home and each family member can be considered as its object. So this implies with president position as well. Each new president can be the object of that class. Creating a class with name as 'lincon' will lead to confusing code management.

2. Choice(c) is correct, ie., An object of a subclass can be treated as an object of the superclass.

  • Option-a is false because constructor is a method(in superclass) and it cant be inherited into sub class.
  • Option - b is false because private member(variables) in super class can't be inherited to sub class as well.
  • Object of a sublass(derived class) can be used to peroform same functionality as object of superclass(base class).

3. Choice(D) is correct, ie., All of the above

  • Pair programming benefits include collective ownership of codes, multiplied learning among peers, code critics in a constructive way, refinement , building trust among employees etc.

Related Solutions

How can we come up with the numbers for the Benefits / Disbenefit / and Cost?...
How can we come up with the numbers for the Benefits / Disbenefit / and Cost? of these topics for Covid-19 Wash Hands: $ Benefits, and $ Cost Avoid Close Contact: $ Benefits, and $ Cost Wearing Mask: $ Benefits, and $ Cost Hand sanatizers: $ Benefits, and $ Cost Monitor Your Health: $ Benefits, and $ Cost Medical Health Care: $ Benefits, and $ Cost Vaccination: $ Benefits, and $ Cost Please Help me out, I can't seem to...
what business we can relate to and come up with a news presentation on firms in...
what business we can relate to and come up with a news presentation on firms in competitive markets
can you explain in details how did we come up with this answer and how to...
can you explain in details how did we come up with this answer and how to answer similar.. what is the economic concept behind it A serious drought has created a shortage of food across the country. In an attempt to maximize profits, one grocery store decided to auction off its limited supply of food. Which of the following scenarios is the MOST likely to occur in this situation? A. The willingness to pay for food would rise. B. The...
can you explain in details how did we come up with this answer and how to...
can you explain in details how did we come up with this answer and how to answer similar what is the economic concept behind this NO.152 A pharmaceutical company was recently awarded a 20 year patent for a new medicine it has developed. Which of the following results could be a consequence of this patent? (Select all that apply.) A. The high price of the medicine will result in insufficient demand. B. The pharmaceutical company will charge higher prices for...
What kind of policy measures can we come up with to reduce the negative impacts and...
What kind of policy measures can we come up with to reduce the negative impacts and increase the positive impacts of minimum wage? (This is a normative question, but try to use as much economic theory as you can to answer this part)
can you explain in details how did we come up with this answer and how to...
can you explain in details how did we come up with this answer and how to answer similar NO.148 Two years ago, the purchasing manager at a company spent $25,000 on a new machine that would improve production efficiency at the company. The manufacturers of the machine release an updated model that costs $35,000 and that promises to further improve production efficiency. Under what conditions should the purchasing manager upgrade to the new model? A. If the savings from the...
come up with the scenario where housing could give us a WTP to avoid pollution from...
come up with the scenario where housing could give us a WTP to avoid pollution from a nearby coal power plant and a scenario where we could undercover the necessary payment people would be willing to accept to tolerate the coal plant nearby.
Melanie wants to add a direct quotation to her research paper about President Lincoln, from a...
Melanie wants to add a direct quotation to her research paper about President Lincoln, from a book written by Joshua Wolf Shenk.   Choose the correct way to cite the quotation in APA style. “Never had the conditions for a president-elect been so severe, and never had one seemed, by his credentials, so poorly prepared” (2005, Shenk, p. 172). “Never had the conditions for a president-elect been so severe, and never had one seemed, by his credentials, so poorly prepared” (Shenk,...
Discuss ethical issues that may come up in professional settings. What situations may arise that can challenge us?
Discuss ethical issues that may come up in professional settings. What situations may arise that can challenge us? How can our moral compass and ethical standards help us navigate our way through the daily stressful interactions within a business or professional setting?Please discuss the collaboration process, both in general and specifically as it relates to your experience working with the virtual company--how is it working with others? What challenges have you encountered, and what benefits have you found?
Operating Systems: We have learned two methods for the Dining Philosophers Problem. Can you come up...
Operating Systems: We have learned two methods for the Dining Philosophers Problem. Can you come up with other solutions? Make sure your solution works. Wrong solution does not count. (20 points)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT