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

C++ DATA TRANSMIT A company wants to transmit data over the telephone, but they

ID: 3786638 • Letter: C

Question

C++

DATA TRANSMIT A company wants to transmit data over the telephone, but they are concerned that the phones may be tapped. All of their data are transmitted as four-digit integers. They have asked you to write a program that encrypts their data so that it can be transmitted more securely. Your program should read a four-digit integer (only one input) 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, swap the second digit with the fourth and print the encrypted integer. NOTE: Comments and Indentations must be included in this program and future programs, if not, points will be deducted. OUTPUT SAMPLE: Enter a four digit number : 4512 DIGITS 4 5 1 2 lst DIGIT Replacement using modulus 1 2 8 9 ENCRYPTED 8 9 1 2

Explanation / Answer

Encrypted Code is :

Decrypted code is: