As you work through this assignment

profileVerifiedEducator
 (Not rated)
 (Not rated)
Chat

  

As you work through this assignment, indicate the step number and copy and paste the code or write an answer, wherever indicated, in the Word document and the screenshots
 

Perform the following tasks:

1. Open the Buyers project in Eclipse.

 
 

2.  

Add a new method called payForItem to the Buyer interface and the BuyerImpl class. The method in BuyerImpl should write to a message to the standard output that the Buyer is paying for an item.

 
 

3.  

Create a new class called CashBuyer that inherits from the BuyerImpl class. The CashBuyer class will override thepayForItem method.

 
 

4.  

Code the payForItem method to write to a message to the standard output that the CashBuyer object is paying for an item with cash.

 
 

5.  

Add a new class called CreditCardBuyer that will also override thepayForItem method.

 
 

6.  

Code the payForItem method in the class to write to standard output that the CreditCardBuyer object is paying for an object with a credit card.

 
 

7.  

In the BuyerTestDriver class, create and test a CashBuyer object and a CreditBuyer object.

 
 

8.  

Write a brief description of the core object-oriented principles used in this part of the project and describe a justification for their use.

    • 4 years ago
    Answer Attached
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      BuyersKT19.zip