Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started