Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Help for a code?

Panasonic99Panasonic99 Posts: 140Member
with option strict and option explicit on,

Creat an application that allows the user to enter a password that contains, five, six, or seven characters. The application then should create a new password as follows:

Replace all vowels with the letter X.
Replace all number with the letter Z.
Reverse the characters in the password.
For instance, ABC1DEF -> FXDZCBX


Comments

  • kanchikannankanchikannan Posts: 7Member
    : with option strict and option explicit on,
    :
    : Creat an application that allows the user to enter a password that contains, five, six, or seven characters. The application then should create a new password as follows:
    :
    : Replace all vowels with the letter X.
    : Replace all number with the letter Z.
    : Reverse the characters in the password.
    : For instance, ABC1DEF -> FXDZCBX
    :
    :
    :

    Hai,

    The solution is...

    Dim oldpwd As String
    Dim newpwd As String
    Dim ir As Integer

    oldpwd = "ABC1DEF"
    newpwd = ""
    For ir = 1 To Len(oldpwd)
    If InStr("AEIOU", Mid(oldpwd, ir, 1)) Then
    newpwd = "X" + newpwd
    ElseIf InStr("0123456789", Mid(oldpwd, ir, 1)) Then
    newpwd = "Z" + newpwd
    Else
    newpwd = Mid(oldpwd, ir, 1) + newpwd
    End If
    Next
    MsgBox(newpwd)

    With Love,
    Kannan

Sign In or Register to comment.