VB.NET

Moderators: seancampbell
Number of threads: 4020
Number of posts: 10026

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Help for a code? Posted by Panasonic99 on 4 Mar 2005 at 11:57 AM
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


Report
Re: Help for a code? Posted by kanchikannan on 29 Apr 2005 at 3:58 AM
: 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




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.