Open the Jacobson Solution (Jacobson Solutioa.sln) file, which is contained in t
ID: 3623968 • Letter: O
Question
Open the Jacobson Solution (Jacobson Solutioa.sln) file, which is contained in the ClearlyVBChap24Jacobson Solution folder. Open the designer window. The interface provides a text box for entering a password. The text box's Character Casing property is set to Upper. The password can contain 5,6, or 7 characters, but no space characters. The Display New Password button should create and display a new password using the following three rules. First, replace all vowels (A, E, I, O, and U) with the letter X. Second, replace all numbers with the letter Z. Third, reverse the characters in the password. Save the solution, then start and test the application. Stop the application, then close the solution.Explanation / Answer
Dear... sample code: Private Sub xDisplayButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xDisplayButton.ClickDim oldPassword As String
Dim newPassword As String
oldPassword = Me.xOrigPasswordTextBox.Text
newPassword = originalPassword
If oldPassword.Length < 5 Or originalPassword.Length > 7 Then
MessageBox.Show("Password must be 5 to 7 characters long.", "Jacobson", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
newPassword = newPassword.Replace("A", "X")
newPassword = newPassword.Replace("E", "X")
newPassword = newPassword.Replace("I", "X")
newPassword = newPassword.Replace("O", "X")
newPassword = newPassword.Replace("U", "X")
newPassword = newPassword.Replace("1", "Z")
newPassword = newPassword.Replace("2", "Z")
newPassword = newPassword.Replace("3", "Z")
newPassword = newPassword.Replace("4", "Z")
newPassword = newPassword.Replace("5", "Z")
newPassword = newPassword.Replace("6", "Z")
newPassword = newPassword.Replace("7", "Z")
newPassword = newPassword.Replace("8", "Z")
newPassword = newPassword.Replace("9", "Z")
newPassword = newPassword.Replace("0", "Z")
End If
Me.xNewPasswordLabel.Text = newPassword
Dim newword As String = TextBox1.Text
Dim m, j As Integer
Dim temp As String = "" m = newword.Length
For j = m - 1 To 0 Step -1
temp &= newword.substring(j, 1)
Next
MsgBox(temp)
End Sub
End Sub
End Class
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.