Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

password generaters using visual basic 2012. My code is not working. Create a Pa

ID: 3693877 • Letter: P

Question

password generaters using visual basic 2012. My code is not working.

Create a Password generator application as shown below. As usual, make sure the code is properly documented with top level comments at a minimum, and ensure all conversions are explicit. The user enters how many characters the password must be made of, then clicks a Generate button. The output is then a string made of numbers, letters (some of are upper case and some are lower case) along with any other characters you wish to use. The code must use a For loop and no other type of loop. The code must also use the Chr string functions, along with the Random function. The Random function generates a number (you need to figure out the range). The number generated is then used in the Chr function as the ASCII value to generate a character. The code must randomize using a letter, upper case or lower case, a number or some other characters.

Explanation / Answer

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim n, n1 As Integer
Dim Generator As System.Random = New System.Random()
Dim s As String
s = ""
n = Val(TextBox1.Text)
For i = 1 To n
n1 = Generator.Next(1, 128)
s = s & Chr(n1)

Next
TextBox2.Text = s
End Sub
End Class