1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Hatshy [7]
3 years ago
13

A company wants to transmit data over the telephone, but they are concerned that their phones may be tapped. All of their data i

s transmitted as four-digits. They have asked you to write a program that will encrypt their data so that it may be transmitted more securely. Your program should read a four-digit integer and encrypt it as follows: 1. Replace each digit by (the sum of that digit and 3) modulus 10. Then 2. Swap the first digit with the third, and swap the second digit with the fourth. 3. Print the encrypted integer.
Computers and Technology
1 answer:
erastovalidia [21]3 years ago
6 0

Answer:

def encrypt_digit(digit):

   if type(digit) is int or float:

       digit = str(digit)

   hold = list()

   for x in digit:

       d = str((int(x) + 3)%10)

       hold.append(d)

   first = hold.pop(0)

   second = hold.pop(0)

   third = hold.pop(0)

   fourth = hold.pop()

   print(int("".join([third,fourth, first, second])))

encrypt_digit(7836)

Explanation:

The python function accepts a four-digit parameter which represents the data transmitted over the company's telephone network. The function encrypts the data by adding 3 to each digit and getting the modulus of division 10, then the digits are swapped and printed out encrypted and ready for transmission.

You might be interested in
a bus is full of passengers. if you count them by either twos, threes, or fives, there is one left. if you count them by seven t
ruslelena [56]

Answer:

91

Explanation:

You know that the number must end in 6 or 1 to get a left over of 1 when divided by 5. Six won't work because  2  divides evenly into a number ending into 6.

So the number ends in 1.

21 doesn't work because 3 divides into 21 evenly.

31 doesn't work because 7 does not divide into it.

41 doesn't work. 41 is prime. 7 won't divide into it.

51 is divisible by 3

61 seven does not evenly divide into 61.

71 seven leaves a remainder of  1

81 7 leaves a remainder.

91 Answer

4 0
3 years ago
A corporate user is attempting to connect to the company’s Windows domain server on the local network with her new laptop throug
andreev551 [17]

Answer:

B. Windows domain user name and password

Explanation:

Windows domain user name and password are login credentials required for the user to successfully sign in to the Windows domain.

The domain username and password are usually stored on a domain controller rather than on the host.

As a domain user, the computer seeks from the domain controller the privileges assigned to the user, if it gets a positive response from the domain controller, it authorizes the users login credentials without restrictions; else, it denies the user access.

8 0
4 years ago
What is tahe difference between a cone and a prism
Natalka [10]

prism is (geometry) a polyhedron with parallel ends of the same size and shape, the other faces being parallelogram-shaped sides while cone is (label) a surface of revolution formed by rotating a segment of a line around another line that intersects the first line.

4 0
2 years ago
In Java write a method called wordCount that accepts a String as its parameter and returns the number of words in the String. A
mamaluj [8]

Answer:

// here is code in java.

import java.util.*;

// class definition

class Main

{

   // method that return the number of words in the string

   public static int wordCount(String st)

   {

       /* split the string by space " " delimiter

       and save them into  string array*/

       String[] no_words=st.split(" ");

       // find the length of array

       int len= no_words.length;

       //return the length

       return len;

   }

   // driver function

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // scanner object to read input string

       Scanner s=new Scanner(System.in);

        // string variable

       String str;

       //ask user to enter string

       System.out.print("please enter the string: ");

       // read the string from user

       str=s.nextLine();

       // call the function with string parameter

      int tot_words= wordCount(str);

      // print the number of word in string

      System.out.println("total words in the string is : "+tot_words);

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read a string from user with the help of scanner class object.Call the function

wordCount() with string parameter.Here split the string by space " " delimiter.

Save the words into a string array.Find the length of the array and return it.

Then in the main print the number of words in the input string.

Output:

please enter the string: this string has wide spaces

total words in the string is : 5

5 0
4 years ago
What has a code that is freely available for use or modification?
liq [111]

Answer:

Open source software

Explanation:

Open source software is exactly what you think it is, the code to compile the software and run it is available to the public for use or modification.

6 0
3 years ago
Other questions:
  • Samantha received a gaming session as a gift. She would like to have it communicate with her sister Jennifer’s gaming system so
    15·1 answer
  • You need to write th java syntax for the expression “7 is greater than or equal to 3” choose the best answer
    8·1 answer
  • To edit the text in a SmartArt graphic, what must be done first?
    5·1 answer
  • Splunk In most production environments, _______ will be used as the source of data input?
    12·1 answer
  • What part of the System Model is a Flow Chart primarily developed for?
    9·1 answer
  • Open Comments.java and write a class that uses the command window to display the following statement about comments:
    8·1 answer
  • A developer needs to create a visualforce page that displays case data. The page will be used by both support reps and support m
    10·1 answer
  • If you were looking for a record in a very large database and you knew the ID number, which of the following would be the most d
    6·1 answer
  • Provide 50000 customers with internet service, however it is only given a pool of 256 ip addresses. suggest an address allocatio
    14·1 answer
  • What is required when opening a checking account?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!