How can I retain properties of an instance of base class after replacing it with instance of derived class?
I'm practicing OOP by making a cash desk script for an imaginary shop. I created a class called Customers that contains normal visitors. Another class called Members extends Customers and contains members of the shop. The shop offers offers a facility: instead of paying in cash, customers can add some amount to their "pending balance" with the shop. If a customer has a pending balance of $10 and he joins membership of the shop, his pending balance is lost. How do I retain it? Edit: I'm adding the code. https://code.sololearn.com/cNKAK3o8N28e/?ref=app