Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.
Exercise 1 of 1
Practice the first pillar of OOP by deciding what parts of a system should be Public, Private, or Protected.
The Remote Control: Anyone can access.
Internal Wires: Only the TV can touch.
Service Panel: Only family/children can access.
powerButtonmessyInternalWiresvolumeDown()manufacturerDiagnostics()electricityVoltagescreenBrightnessMake sure users don't touch the wires!
Practical exercises to master the concepts.
Create a BankAccount with a private balance. Add methods to deposit and withdraw. The withdraw method should prevent overdrawing.