3.2.3 Java OOPs - User and PasswordGenerator work together

You will modify the User class to allow the PasswordGenerator to create passwords for the user.

After you have made these modifications, on the BlueJ workbench you should be able to create a new user, create a passwordGenerator, pass the passwordGenerator as s parameter in the user's setPassword() method and have a password set in the user.

Modifications to User:

HAS-A:  attributes
    password String

RESPONDS TO: methods
    setPassword(PasswordGenerator pg)
Notice this parameter is object pg that is a PasswordGenerator.
The method will have one line in it.
    password = pg.nextPassword();

Modify setUserData() method to include the password
Comments