Answer it
Abstract class or interface for payments
4 marksYou mark it yourself against the marking points
A school canteen app takes three kinds of payment: card, cash and student account. Every payment has an amount and a date, and every kind of payment must be processed, but each kind is processed in a different way. Only card and student account payments can be refunded. A refund also applies to gift cards, which are a separate class that is not a payment.
Explain why Payment should be an abstract class, and why refunding should be an interface rather than a method in Payment. [4]