Question: Assume s is a string. Write a program that separates a long string ( at least length of 1 6 ) that contains both numbers

Assume s is a string.
Write a program that separates a long string (at least length of 16) that contains both numbers and letters (upper and lower case) into two substrings of numbers and letters.
And then convert theeven numbers in the 'number substring' and upper-case letter in the 'letter string' into ASCII Code Decimal Values.
Example Scenario:String ='56aAww1984sktr235270aYmn145ss785fsq31D0'
Separate them -56198235270145785310(number string) and aAwwsktraYmnssfsqD (letter string). Convert the even numbers in the number string to ASCII Code Decimal Values
6,8,2,2,0,4,8,0(Even Numbers)
54,56,50,50,48,52,56,48(ASCII CODE)
Convert the upper-case letter in letter string to ASCII Code Decimal values.
A, Y, D (Upper-case Letters)
65,89,68(ASCII CODE Decimal Values)
You are required to create a program that showcases the required output for the following question: Many newspapers publish a cryptogram each day, for instance:
VZ FRYSVFU VZCNGVRAG NAQ N YVGGYR VAFRPHER V ZNXR ZVFGNXRF V NZ BHG BS PBAGEBY
NAQNG GVZRF UNEQ GB UNAQYR OHG VS LBH PNAG UNAQYR ZR NG ZL JBEFG GURA LBH FHER NF
URYYQBAG QRFREIR ZR NG ZL ORFG ZNEVYLA ZBAEBR
The deciphered cryptogram is usually a quote from a famous author or celebrity.
To get the original quote, you should replace each character in the ciphered quote using a shift keyvalue (s) condition.
Example 1: If ciphered quote is AB, and 's' is 1, then original quote is ZA
Example 2: If ciphered quote is AB, and 's' is 2, then original quote is YZ
Similarly decrypting the provided cryptogram using a 'certain' shift key value (s) gives original quote.
Find the shift kev (s) the gives the original quote.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!