Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 6th, 2005, 6:22 PM   #1
GM Man
Newbie
 
Join Date: Feb 2005
Posts: 3
Rep Power: 0 GM Man is on a distinguished road
Question I'm new and Im lost with programming

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.
GM Man is offline   Reply With Quote
Old Feb 7th, 2005, 9:29 AM   #2
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
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!
Pizentios is offline   Reply With Quote
Old Feb 7th, 2005, 10:14 AM   #3
GM Man
Newbie
 
Join Date: Feb 2005
Posts: 3
Rep Power: 0 GM Man is on a distinguished road
Quote:
Originally Posted by Pizentios
Sounds like a homework project to me. Do you have any source to post?
Your right, it is a homework project, and I dont want it written out for me, I just want to know how to start something like this. Its been a pain trying to figure this out. Thanks.
GM Man is offline   Reply With Quote
Old Feb 7th, 2005, 11:14 AM   #4
Hockeyman
Programmer
 
Hockeyman's Avatar
 
Join Date: Jan 2005
Location: Vancouver, Canada
Posts: 60
Rep Power: 4 Hockeyman is on a distinguished road
Send a message via MSN to Hockeyman
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. ~

Hockeyman is offline   Reply With Quote
Old Feb 7th, 2005, 1:42 PM   #5
GM Man
Newbie
 
Join Date: Feb 2005
Posts: 3
Rep Power: 0 GM Man is on a distinguished road
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??
GM Man is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:10 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC