I don't know where to begin. 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. Here is my code.... Public Class frmMain Private 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 Sub Private Sub txtWords_Enter(sender As Object, e As EventArgs) Handles txtWords.Enter txtWords.SelectAll() End Sub Private Sub txtWords_TextChanged(sender As Object, e As EventArgs) Handles txtWords.TextChanged lblPassword.Text = String.Empty End Sub Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub End Class

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I don't know where to begin.

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.

Here is my code....

Public Class frmMain
Private 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 Sub

Private Sub txtWords_Enter(sender As Object, e As EventArgs) Handles txtWords.Enter
txtWords.SelectAll()
End Sub

Private Sub txtWords_TextChanged(sender As Object, e As EventArgs) Handles txtWords.TextChanged
lblPassword.Text = String.Empty
End Sub

Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
Me.Close()
End Sub

Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub
End Class

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Form and its Elements
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education