home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 1896
Discussions: 188,398, Posts: 2,243,591, Members: 232,627
Old December 7th, 2004, 11:21 AM   Digg it!   #1 (permalink)
Ultimate Member
 
Join Date: Oct 2003
Location: Aztec, New Mexico
Posts: 1,608
Send a message via AIM to MadMan2k Send a message via MSN to MadMan2k
Another program

My C++ class this semester is almost over, and just to experiment with it, I made this program:

Code:
#include <iostream>
#include <string>
using namespace std;
int a = 0;
int b = 0;
string inString;
int choice;

string encrypt(string & inString)
{
for(a = 0; a <= 3; a++)
{
inString[a] = inString[a] + 3;
}
return inString;
}
string decrypt(string & inString)
{
for(a = 0; a <= 3; a++)
{
inString[a] = inString[a] - 3;
}
return inString;
}


int main()
{
if(b == 0)
{
cout << "Would you like to:" << endl;
cout << "1) Encrypt a string" << endl;
cout << "2) Decrypt a string" << endl;
cout << "3) Quit" << endl; "? ";
cin >> choice;

if(choice == 1)
{
cout << "Enter a string to be encrypted: ";
cin >> inString;
cout << "The encrypted string is: " << encrypt(inString) << endl;
}
else if(choice == 2)
{
cout << "Enter an encrypted string to decrypt: ";
cin >> inString;
cout << "The decrypted string is: " << decrypt(inString) << endl;
}
else if(choice == 3)
{
b == 1;
}

else
{
cout << "Invalid input, please try again." << endl;
}
}

return 0;
}
I call it 'encrypt', but it actually just raises the value of each letter in the string inputted, by 3. A becomes D, and so forth.

It doesn't stay open after selecting '1', or '2' when ran through windows, but the .EXE file is in here:

http://www.jonbuder.us/files/encrypt.rar
__________________
jonbuder.com

MadMan2k is offline   Reply With Quote
Reply


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

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
just made the switch Whitehawk Graphics Cards and Displays 21 June 5th, 2004 09:21 PM
quick windowz taskbar question VHockey86 Applications and Operating Systems 11 December 7th, 2003 06:15 PM
Flash Help oolunchbox Graphic Design and Digital Photography 4 November 20th, 2002 12:55 PM
Opera vs. IE? Xster Applications and Operating Systems 14 October 25th, 2002 02:08 AM
Windows XP Application Question... Martoch Applications and Operating Systems 6 June 12th, 2002 02:32 PM

Most Active Discussions
Is It Just Me? (2904)
Unarmed man on his stomach shot by .. (6)
3-days in and no threads about Gaza (161)
New Build ( Finally ) (6)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
Folderchat Weekday thread (444)
Upgrading RAM (6)
Recent Discussions
Left 4 Dead Small Freezes (3)
RCA 52Inch HDTV wont turn on (4)
wishin i could edit my aol prof.. (0)
For cheap price and good qualit.. (0)
Sporadic internet connectivity (2)
Assassins Creed PC Problems (40)
I think my PSU is dieing (1)
building a gaming computer, inp.. (0)
Iming and surfing slowed down (3)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 03:19 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28