Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Encryption as Follows: Replace each digit by (the sum of that digit and 7) Mod10

ID: 3609105 • Letter: E

Question

Encryption as Follows: Replace each digit by (the sum of that digit and 7) Mod10. then swap the first digit with the third, and swap the seconddigit with the fourth. I am having trouble with swappping the first with the thirdand second with the fourth. Also, How do I decrypt an encrypted four digit integerthat the user inputted to decrypt it to form the originalnumber?? Encryption as Follows: Replace each digit by (the sum of that digit and 7) Mod10. then swap the first digit with the third, and swap the seconddigit with the fourth. I am having trouble with swappping the first with the thirdand second with the fourth. Also, How do I decrypt an encrypted four digit integerthat the user inputted to decrypt it to form the originalnumber??

Explanation / Answer

please rate - thanks could have been done much more efficiently with arrays/functionsbut you didn't say what to use and I don't have thebook.   If you need, message me and I'll make thechanges #include int main() {int num ,digit1,digit2,digit3,digit4,temp; coutnum; while(num>0) {    digit1=(num/1000+7)%10;    num=num%1000;    digit2=(num/100+7)%10;    num=num%100;    digit3=(num/10+7)%10;    digit4=(num%10+7)%10;    cout