I have understood the int n is the parameter that is the password length. I Still don't understand the double parameter though.
Remember: the person who was coding this wasn't writing good code! Maybe that parameter was a left-over from some previous version of the code...