Question
I need some help writing code for the following problems: Step 1 Write the code for the Count Vowels button click event. The subroutine should
I need some help writing code for the following problems:
Step 1
Write the code for the Count Vowels button click event. The subroutine should get the text from txtSentence and pass it to a function called CountVowels. The CountVowels should count all the vowels in the sentence( CASE INSENSITIVE ) and return the count. The Count Vowels button click subroutine should then display a message box with the vowel count.
Write the code for the Count Words button click event. This is the same as the previous problem except you should count words instead of vowels.
Write the code for the Reverse button click event. The subroutine should get the text from txtSentence and pass it to a function called ReverseString. The ReverseString function should reverse the string and return it. For example ReverseString( ABC ) should return CBA. The Reverse button click subroutine should then update the text in txtSentence with the reversed string. You cannot use the StrReverse function.
Step 2
Write the code for the Break Apart button click event. The subroutine should get the text from txtRecord and pass it to a subroutine called BreakApartRecord. The BreakApartRecord subroutine should break apart strRecord into fields and populate the txtField# textboxes. A field is delimited by a comma. Ignore anything after the 6th comma. The Break Apart button click subroutine should also clear txtRecord.
For example the Record #1, James E. Blues, 123 Elm Street, Cincinnati, Ohio 45242, should be broken up into the fields as shown in the screen capture above.
Be sure to trim any leading and trailing spaces from the fields.
*** There may be less than 6 commas in the field. For example: 1, 2, 3, Make sure you code handles this.
Write the code for the Put Together button click event. The subroutine should call a function PutFieldsTogether. The PutFieldsTogether function should get the text from all the txtField# textboxes and create a string by concatenating the fields together with comma&space in between each field. The PutFieldsTogether function should return this string. The Put Together button click subroutine should then update the text in txtRecord with the returned string. The Put Together button click subroutine should also clear the txtField# textboxes.
Write the code for the Format Phone Number button click event. The subroutine should get the text from txtPhoneNumber and pass it to a function called FormatPhoneNumber. The FormatPhoneNumber function should add parentheses around the area code and insert dashes before the prefix and trunk. The FormatPhoneNumber should return the formatted phone number. The Format Phone Number click event should update the text in txtFormattedPhoneNumber with that string.
Only format phone numbers that are 10 characters long and composed of digits.
Visual Basic/.NET is the language; apologies for this ommision.
Thanks!
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