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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started