Question: In this exercise, you modify the Password application from this chapter's Apply lesson. Use Windows to make a copy of the Password Solution folder. Rename

In this exercise, you modify the Password application from this chapter's Apply lesson. Use Windows to make a copy of the Password Solution folder. Rename the copy Password Solution-Advanced. Open the Password Solution.sln file contained in the Password Solution-Advanced folder. Before inserting the number, the btnCreate_Click procedure should alternate the case of each letter in the password. If the first character is lowercase, the procedure should change it to uppercase; it should then change the second letter to lowercase, the third letter to uppercase, and so on. For example, if the password is abcd, the procedure should change it to AbCd. On the other hand, if the first character is uppercase, the procedure should change it to lowercase and then alternate the case of the following letters. For example, if the password is Abcd, the procedure should change it to aBcD. Modify the procedure's code. Save the solution and then start and test the application. (If the user enters "May the Force be with you", the procedure should display m6TfBwY. If the user enters "may the Force be with you", the procedure should display M6tFbWy.)(F7.1, F7.2, F7.4, F7.6, F7.7, F7.10, A7.2) I need help with thPrivate Sub btnCreate_Click(sender As Object, e As EventArgs) Handles btnCreate.Click
' Create a password.
Dim strWords As String
Dim strPassword As String
Dim intSpaceIndex As Integer
strWords = txtWords.Text.Trim
If strWords <> String.Empty Then
' Assign the first character as the password.
strPassword = strWords(0)
' Search for the first space in the input.
intSpaceIndex = strWords.IndexOf("")
Do Until intSpaceIndex =-1
' Concatenate the character that follows
' the space to the password.
strPassword = strPassword & strWords(intSpaceIndex +1)
' Search for the next space.
intSpaceIndex = strWords.IndexOf("", intSpaceIndex +1)
Loop
' Insert the number after the first character.
strPassword = strPassword.Insert(1, strPassword.Length.ToString)
' Display the final password.
lblPassword.Text = strPassword
End If
End Subis part of the code.Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!