Payment System
MediumDesign an interface/abstract class Payment with a method process(amount).
Implement CreditCard, PayPal, and Cash.
Use polymorphism to process different payments in an online store.
OOP Focus: Abstraction via interfaces.
Note: This is statement-only in the current Practice version; stdout should be empty.
Loading editor...
Output
Run or submit to see output.