Computer Programming Problem

August 29, 2009 at 23:21:32
Specs: Windows XP
A company wants to transmit data over the telephone, but it is concerned that its phones may be tapped. All of its data is transmitted as four-digit integers. It has asked you to write a program that will encrypt its data so that the data
may be transmitted more securely. Your script should read a four digit integer entered by the user in a prompt dialog and encrypt it as follows: Replace each digit by (the sum
of that digit plus 7) modulus 10. Then swap the first digit with the third, and swap the second digit with the fourth. Write a separate program that encrypts the four-digit number and decrypts it form to its real number..

please..help me..this is our project..I really don't get it...please..can somebody please teach me?or either post the whole code for it?deadline for my project is next week..please..have mercy..God Bless!


See More: Computer Programming Problem

Report •


#1
August 29, 2009 at 23:32:34
In some circles this request would be considered Cheating.

Get off the Net & hit the Books.

There is nothing to learn from someone who already agrees with you.


Report •

#2
August 30, 2009 at 03:31:17
Awesome. When you get past the, "Have people on the Internet do my homework for free" stage, let us know.

If you start doing your homework yourself, but run into problems, feel free to ask us. Make sure to include the code you're having problems with.

If you prefer to have the Internet to do your homework, well, that's an option, too.


Report •

#3
August 30, 2009 at 03:43:46
nope...i have my code here...but I'm not that confident if it's correct or not..I'm only a first year college student Major in Information technology..our teacher gave us a project which he did not taught us..in other words, we are the ones who are going to find it out..but I'm not that smart..that's why I'm asking questions here..I really thought this site could help..but instead it gave me a conclusion that I was about to cheat..
I've already searched the net..but I'm having a hard time since I'm only a beginner..I found many answers on it..but i don't know how to analyze it since we're only taking the basic coding/programming in codeblocks..hope you understand..

here is my code:for encrypt and I don't know how to decrypt..can somebody help me with these?

#include <iostream>

using namespace std;

int main()
{
int code0, code1, code2, code3;
int sum1, sum2, sum3, sum4;

cout<<"\n\nEnter your First Number:\t";
cin>>code0;
cout<<"\n\nEnter your Second Number:\t";
cin>>code1;
cout<<"\n\nEnter your Third Number:\t";
cin>>code2;
cout<<"\n\nEnter your Fourth Number:\t";
cin>>code3;

sum1=code2+7;
sum2=code3+7;
sum3=code0+7;
sum4=code1+7;

cout<<"\nYour Code is:\t";
cout<<sum1%10;
cout<<sum2%10;
cout<<sum3%10;
cout<<sum4%10;

string case0 ("case2");
string case1 ("case3");

swap (case0, case1);

}

see?it's not correct...because a user should prompt a 4-digit number..mine is only 1..I dont know how to make it 4..:(


Report •

Related Solutions

#4
August 30, 2009 at 06:50:49
Since I already gave a reply without telling you to repost this in the Programming forum, I guess telling you now would only serve to make me look lazy. So, for future reference, programming questions should be asked on the Programming forum.

I dont know how to make it 4
Oh, that's easy. Ask for a 4 digit number, % 10 it to get a digit, then /= 10 the 4 digit number. Repeat 3 more times. If you use an array, as you should, this becomes an easy for loop. You could even do your "encryption" in that for loop.

I don't know how to decrypt
For each digit: Add 3, Mod 10, swap.


Report •


Ask Question