![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2005
Posts: 3
Rep Power: 0
![]() |
Well I'm new to all of this VB programming and I'm having a bit of a hard time getting started. The question I have might seem basic to some of you, but I'm totally lost. I need to write a program that encrypts data as four digit integers. The program should read the four digit integer and encrypt as follows, replace each digit by the sum of that digit plus seven. After that it has to swap the first digit with the third and swap the second with the fourth.
My head is starting to hurt from banging it against the wall, so any help would be appreciated. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() |
Sounds like a homework project to me. Do you have any source to post?
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#3 | |
|
Newbie
Join Date: Feb 2005
Posts: 3
Rep Power: 0
![]() |
Quote:
|
|
|
|
|
|
|
#4 |
|
Programmer
|
The first step is to work out the algorithm you want to use...once you have that all you need to do is translate it into code...
For this project, I would declare 5 int variables - A,B,C,D,temp. Read digit 1 into A, digit 2 into B, etc to D (haven't used VB for a while so forget what the function you want is called) Add 7 to A (A = A+7), 7 to B, etc. Next you need to do your swaps. Move C to the temp variable (temp = C). Move A variable to location C (C = A). Move temp value into A (A = temp). Do the same type of swap with the 2nd and 4th digit (can re-use the temp variable). Hope that's enough to get you started ![]()
__________________
~ You know, Hobbes, some days even my lucky rocketship underpants don't help. ~ read my blog @ My Lucky Rocketship Underpants
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Feb 2005
Posts: 3
Rep Power: 0
![]() |
Thanks Hockeyman and everyone else for the help , that is what I need to get going. As all of you can tell programming is not my thing. Does any out there live in Denver and want some extra cash for tutoring??
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|