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 SolutionAdvanced. Open the Password Solution.sln file contained in the Password SolutionAdvanced folder. Before inserting the number, the btnCreateClick 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 mTfBwY If the user enters "may the Force be with you", the procedure should display MtFbWyF F F F F F A I need help with thPrivate Sub btnCreateClicksender 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
Search for the first space in the input.
intSpaceIndex strWords.IndexOf
Do Until intSpaceIndex
Concatenate the character that follows
the space to the password.
strPassword strPassword & strWordsintSpaceIndex
Search for the next space.
intSpaceIndex strWords.IndexOf intSpaceIndex
Loop
Insert the number after the first character.
strPassword strPassword.Insert 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
