Computer Science - Object-Oriented Programming - Encapsulation - The Vending Machine Analogy
Interactive vending machine. Student can: 1) Insert coins (public interface: insert_coin()), 2) Press button to select item (public: select_item()). They CANNOT: reach inside to grab items, open the cash box, change prices. Each attempt to 'hack' shows: 'ACCESS DENIED - This is a PRIVATE operation!'