anonymous
  • anonymous
A company wants to transmit data over the telephone lines. All their data is transmitted as four-digit integers. write a program that will encrypt their data so that it may be transmitted more securely. Your program should read a four digit number and encrypt as follows: replace each digit by the remainder after the sum of that digit plus 7 is divided by 10. Then swap the first digit with the third, and swap the second digit with the fourth. Then print the encypted integer. Write a seperate program that inputs an encrypted four-digit integer and decrypts it to form the original number
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
You need to use While Loop too
anonymous
  • anonymous
Here is what i have so far... #include using namespace std; int main(){ int num=0;int encrypted_num=0;int digit[3]; cout<< " Input: " cin>>num; if (num> 1000 || num<1000){ cout<< "
anonymous
  • anonymous
you might want to use an array to keep the numbers. and......is the while loop really required?

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
#include #include using namespace std; int main() { int num[4]; int a,b,c; cin >>a; if (a<10000) { if(a>1000) { for(int i=0; i<4;i++){ b=pow(10, i+1); num[i]=a%b; a-=a%b; if (i>0){ c=pow(10,i); cout<>a; } for(int i=0;i<4;i++){ num[i]+=7; num[i]=num[i]%10; } cout<
anonymous
  • anonymous
sample code for using a array to keep the numbers for easy reference. to interchange the values, keep the element in another symbol before assigning it away.
anonymous
  • anonymous
Too late man. I failed
anonymous
  • anonymous
sigh. i guess that's no help then. LOL good luck next time
anonymous
  • anonymous
Hope so

Looking for something else?

Not the answer you are looking for? Search for more explanations.