Computing.Net > Forums > Programming > Visual Basic

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Visual Basic

Reply to Message Icon

Name: rickbill
Date: February 20, 2009 at 16:50:48 Pacific
OS: Windows Vista
Subcategory: C/C++
Comment:

Here's what I have so far.

I need to Replace each digit by(the sum of the digit and 7) modulo 10. Which I did.

But then, swap the first digit with the third, and the second digit with the fourth.

THEN
write a second program that inputs an encryped four-digit Integer and decrypts it form the original number

This is what I have so far.

Module Module1

Sub Main()
Dim numberOne As Integer
Dim encrypNumber As Integer
Dim reminder As Integer
Dim multiplier As Integer

Console.WriteLine("Please enter a four digit number")
numberOne = Console.ReadLine()

encrypNumber = 0
multiplier = 1

While numberOne > 0

reminder = numberOne Mod 10

encrypNumber += multiplier * ((reminder + 7) Mod 10)

numberOne = numberOne / 10

multiplier = multiplier * 10


End While

Console.WriteLine("The encrypted number is: " & encrypNumber)

End Sub

End Module



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Visual Basic

List Databses is Visual Basic 6 www.computing.net/answers/programming/list-databses-is-visual-basic-6/15612.html

visual basic and C# www.computing.net/answers/programming/visual-basic-and-c/1113.html

visual basic www.computing.net/answers/programming/visual-basic/9625.html