The purpose of this assignment was to create a random password generator that would change based off of the chosen criteria that the user decided upon (the length of the password and whether to user, uppercase letters, lowercase letters, numbers and special characters). I built this project so as to be able to apply my new knowledge of javascript in a way that would be able to show off my newfound capabilities. This includes variables, functions, if/else statements, for loops, prompts, confirms, alerts, and console logs.
- Using a pencil and paper, I pseudocoded the process that would need to occur in order for this password to be randomly generated
- After making sure that the javascript was properly linked to the HTML I then created the necesscary variables for the password generator
- I then built a function that all of the javacript would be written in that will develop the password
- I created a prompt that would ask the user the desired length of the password (between 8-128 characters). If they chose a length that did not meet the criteria, they would be alerted that they need to choose one within it and the function would end.
- I then created a series of confirmation questions that would ask the user what kind of criteria they want for their password. I placed an if statement after each confirm that will populate an empty variable with the desired criteria.
- After all of the criteria had been chosen I built a for loop that would take the input of desired password length and criteria and would construct a randomized password.
- If the user chose at least one of the four criteria, their random password will populate in the box for the user to see. If not, it will alert them that they need to accept at least one of the four criteria.
- Originally I did not know that you could create an empty variable that would be populated at a later point. This led to a lot of confusion and frustration in figuring out how to compile the user's choices.
- I did not know where to place the code originally, and placed my code within the pre-existing function writePassword instead of creating my own function.
- I struggled to build a for loop that correctly chose the length the user decided upon. I resolved this issue by discussing with my group about for loops and how they can develop output.
- How to pseudocode
- How to build a for loop on my own
- How to create empty variables that will be filled out at a later point
- How to use a for loop that will create randomized output