Question: Write an abstract function named receivePay in interface with return type double and no parameters. Write another incomplete function, name Show with return type

Write an abstract function named receivePay in interface with return type double and no parameters. Write

Write an abstract function named receivePay in interface with return type double and no parameters. Write another incomplete function, name Show with return type void and an argument of type int in that interface. Build a class with name Bill that implements the above interface. Bill class with name Billld, itemsquantity and itemsprice with proper datatypes with private access. Define two constructors, one default and other is parameterized to initialize the class members. Now receivePay has to be implemented in such a way that its displays product of itemsquantity and itemsprice and Display function will display the Billld.Can we do same task with abstract class instead of interface?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Java interface Payment double receivePay void Showint item class Bill implements Payment private Str... View full answer

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 Programming Questions!