Secret Channels
A company uses public Internet to carry its phone service. The voice data will be encrypted before sending to Internet. The encryption algorithm is as follows:
For each four-digit decimal integer,
(1) Add 5 to each digit, divide the sum by 10 and use the remainder to replace the digit,
(2) Swap 1st-digit with 4th-digit,
(3) Swap 2nd-digit with 3rd-digit.
For this assignment, write a program named Encrypted.java to perform the following tasks:
1. Implement a static method as specified below: public static int encrypt(int data) - this method takes voice data and return encrypted data by applying the encryption algorithm
2. Implement the main method, which reads data from the provided data file, then use the encrypt method to encrypt the voice data and print the encrypted voice data.
Input: A series of lines. Each line is a positive four-digit decimal integer.
Output: In each line, print the encrypted four-digit decimal integer.