Question: Intro to Java Interfaces Create an interface called Payable that requires a method called getTotalDue that returns a double. We want to be able to

Intro to Java Interfaces

Create an interface called Payable that requires a method called getTotalDue that returns a double. We want to be able to pay employees and other items. Create the following classes that also implement the Payable interface (LegalServicesBill, DomainNameRegister, and SoftwareLicense)

LegalServicesBill

CaseName

CaseNumber

Hours

Rate

Expenses

Status (paid or not)

Others?

DomainNameRegistration

domainName

feePerYear

Others?

SoftwareLicense

Determine required variables

Write getters and setters for all variables. Write at least one constructor for each class. Each class listed above should implement the Payable interface.

Add a toString method that will return something that is logical for that class.

In the Driver class create a collection (ArrayList) of Payable type. Add at least one type of legal services bill, domain name registration, and software license to the collection. Loop through the collection and call toString and getTotalDue amount and print it.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!