If you ask me what is my date of birth? I say, my date of birth...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
If you ask me what is my date of birth? I say, my date of birth is 87-75-2886. Huh!!! What is that? If you sit down peacefully, you probably will say 87 is the day, 75 is the month, and 2886 definitely is the year. Question arises, how to relate these integers to the day, the month and the year? Give a non-negative integer n less than 10000, we can say n is a "4-digit" integer. What happens if n is a 3-digit or 2-digit or even a single digit? Well, you can assume that some leading zero(s) are implicitly defined for these integers, for example, if n = 78, implicitly n = 0078. In the study of Cryptography, may be one of your future subjects, we use the terms encryption and decryption. Here is how I encrypt a 4-digits integer: (a) Add 7 to each of the digits and modulus the sum by 10 (b) Swap the 1" and the 3 digits; the 2" and the 4 digits (c) Form the new integer abcd where a is the 1" digit, b the 2 digit and etc. Some of the digits may be zero(s). To decrypt (recover back) the encrypted integer: (a) Add 3 to each of the digits and modulus the sum by 10 (b) As above for the swapping (e) As above in forming the new integer. Write a Java program to implement the encryption and the decryption. The following shows the interactions and the displays: Enter 4 digits integer to be encrypted: 9835 Encrypted integer is 0265 Enter 4 digits integer to be decrypted: 0265 Decrypted integer is 9835 During the demo, tell me what my date of birth is and assume that I didn't tell he If you ask me what is my date of birth? I say, my date of birth is 87-75-2886. Huh!!! What is that? If you sit down peacefully, you probably will say 87 is the day, 75 is the month, and 2886 definitely is the year. Question arises, how to relate these integers to the day, the month and the year? Give a non-negative integer n less than 10000, we can say n is a "4-digit" integer. What happens if n is a 3-digit or 2-digit or even a single digit? Well, you can assume that some leading zero(s) are implicitly defined for these integers, for example, if n = 78, implicitly n = 0078. In the study of Cryptography, may be one of your future subjects, we use the terms encryption and decryption. Here is how I encrypt a 4-digits integer: (a) Add 7 to each of the digits and modulus the sum by 10 (b) Swap the 1" and the 3 digits; the 2" and the 4 digits (c) Form the new integer abcd where a is the 1" digit, b the 2 digit and etc. Some of the digits may be zero(s). To decrypt (recover back) the encrypted integer: (a) Add 3 to each of the digits and modulus the sum by 10 (b) As above for the swapping (e) As above in forming the new integer. Write a Java program to implement the encryption and the decryption. The following shows the interactions and the displays: Enter 4 digits integer to be encrypted: 9835 Encrypted integer is 0265 Enter 4 digits integer to be decrypted: 0265 Decrypted integer is 9835 During the demo, tell me what my date of birth is and assume that I didn't tell he
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
What percentage of the American opportunity tax credit may be refundable?
-
Is Jo Goodwin Parker's Essay Effective or Ineffective? The answer to this question above (effective or ineffective) will be your thesis. What is Poverty? Jo Goodwin Parker (1971) You ask me what is...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Determine the global extreme values of the function on the given domain. f(x, y) = 5x- 3y, y x-2, yz-x-2, y 3
-
Determine whether the force-and-couple system shown can be reduced to a single equivalent force R. If it can, determine R and the point where the line of action of R intersects the yz plane if it...
-
A Pitot-static tube is used to measure the Mach number on a supersonic aircraft . The tube, because of its bluntness, creates a normal shock wave as shown. The absolute total pressure downstream of...
-
How does a data management system differ from a communication system?
-
Radhika's Radiology Centre (RRC) performs X-rays, ultrasounds, CT scans, and MRIs. RRC has developed a reputation as a top radiology centre in the area. RRC has achieved this status because it...
-
Suppose that there are three firms in a region that are producing a common emission. The marginal abatement cost (MAC) for each firm is given by: MAC1 240-2E1 MAC2 192-1.6E2 MAC3 = 320 -2.67E3 The...
-
The proposed rates were not in the range the CEO expected given the pricing analysis. The CEO has asked the pricing actuary to verify the total projected loss cost excluding potential large storm...
-
Look over the image in the top section and choose which piece from the bottom should be placed in the question mark (?) that would be next in the sequence. ? Select the missing piece [?] below
-
Which one of the following lists only includes amounts that are components of earned income for RRSP purposes Automobile standby charge salespersons expenses and resource royalties Business income or...
-
If a corporation app Question Content Area On January 1, 2020, Medley Corporation sold $200,000 of its 14%, five-year bonds dated January 1, 2020, for $206,000 total cash. The bonds sold appropriated...
-
Solve the equation using logarithms, 9* -10 1
-
How does the commodification of ethnic art impact the autonomy and agency of indigenous artists and communities, and what measures can be taken to address these concerns ?
-
Determine the second derivative of 2x + y = 1 4y[Hint: Implicit Differentiation]
-
79. Assume that a security is fairly priced and has an expected rate of return of 0.17. The market expected rate of return is 0.11 and the risk-free rate is 0.04. The beta of the stock is A. 1.25 B....
-
The first law of thermodynamics is sometimes whimsically stated as, You cant get something for nothing, and the second law as, You cant even break even. Explain how these statements could be...
-
1. Don't require Spitzer "connectors" to reveal their affiliation with the corporate word-of-mouth marketing campaign. They don't have to recommend a product they don't believe in. 2. Require that...
-
What are the major differences between manufacturing and service organizations? Give examples of how each type might benefit from using Web 2.0 tools such as micro blogging and social networks.
-
In September 2013, Tokyo Electric Power Company (Tepco) reported highly contaminated water leaking from a storage tank at the Fukushima nuclear power plant crippled in a March 2011 earthquake and...
-
Selected transactions from the journal of Wong Consultants are presented below (amounts in thousands). Instructions a. Post the transactions to T-accounts. b. Prepare a trial balance at August 31,...
-
The T-accounts below summarize the ledger of Negrete Landscaping at the end of the first month of operations (amounts in ). Instructions a. Prepare the complete general journal (including...
-
Lennon Industries had the following transactions. 1. Borrowed 5,000 from the bank by signing a note. 2. Paid 3,900 cash for a computer. 3. Purchased 650 of supplies on account. Instructions a....
Study smarter with the SolutionInn App