User Requirements

Use VB to develop an application that will allow the user to input a character string, and produce the following result:

• Output the string rotated to the right by a user-defined number of characters (0 or more). For example, "Hello world!" rotated by 2 characters would be: "d!Hello worl".
• Output the string rotated left by a user-defined number of characters (0 or more)
• Output the string backwards. That means "Hello world!" becomes "!dlrow 0lleH".
• Output the number of characters in the string. For example, "Hello world!" has 12 characters.
• Output the string with the spaces replaced by underscores. "Hello world!" becomes "Hello_world!"

Program Requirements

• You must center all forms on the screen using a common procedure.
• You must use at least one user-defined FUNCTION and one user-define SUB procedure.
• You need to provide a way to exit the program gracefully.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

Public Class Form1

    ''' <summary>
    ''' fire when exit button is clicked
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    Private Sub ButtonExit_Click(sender As Object, e As EventArgs) Handles ButtonExit.Click
       If MsgBox("Are you sure you want to exit?", MsgBoxStyle.OkCancel) = MsgBoxResult.Ok Then
       End If
    End Sub

    ''' <summary>
    ''' fire when run button is clicked
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    Private Sub ButtonRun_Click(sender As Object, e As EventArgs) Handles ButtonRun.Click
       ' get input
       Dim inputStr As String = TextBoxInputString.Text
       inputStr = Trim(inputStr)
       ' check for input error
       If inputStr.Length = 0 Then
            MessageBox.Show("The input string is invalid")
       End If

       ' get input, try to convert string to integer, check for input error
       Dim inputNum As Integer
       If Not Integer.TryParse(Trim(TextBoxInputNumber.Text), inputNum) Then
            MessageBox.Show("The input number is invalid")
       End If

       ' show result on screen
       showResult(inputStr, inputNum)

    End Sub...

By purchasing this solution you'll be able to access the following files:

for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Visual Basic Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats