1.3-Object-Georienteerd-Programmeren

User accounts

Provided is the class UserAccount as you might remember from the previous course Introduction to Programming. The obvious problem with this class is that, at any given moment, you have access to the internal password to either read or (even worse) change. In short: there is currently nothing protecting the UserAccount.

Apply your learned techniques with encapsulation to ensure that both the username and password are kept safe. To do this, implement the following:

You can test your solution by adding a few lines of code to the provided project.

Examples for inspiration

Preview

Preview

Preview

Preview