Question 2: Encoding Cryptography is the study of trying to create secure information by obscuring the original message. One simple encryption method is to substitute letters from the original message with other letters. To make it harder to decrypt the hidden message, we may also remove clues such as the length of the words in the message and any punctuation or capitalization. Write a function encode that consumes a string message. The function produces a string which is encrypted according the following procedure: • Only the letters from the original message will be encrypted. Other characters such as spaces, punctuation, numeric digits, etc. are not included in the encrypted message at all. • The encrypted message will only contain uppercase letters. • Each letter will be replaced by the uppercase letter at the opposite end of the English alphabet. In other words, A or a will become z, B or b will become Y, C or c will become x, .., z or z will become A. • The encrypted message will have a single space separating each letter. You may assume that the letters in message are English letters only. For example: > (encode "Cat") 2 "X Z G" |> (encode "A")| 1 4 " > (encode "Is this correct?") 6 "R H G SRH XLII V X G" Additional Restrictions • For this question you are only allowed to define one named function: encode. You may define local constants. There will be severe correctness mark penalties for solutions that include any named helper functions. • You may use lambda expressions in your solution within the application of other functions. However remember that an expression like this: (define function (lambda ...)) is defining a named function. Any lambda expressions in your solution should only appear as part of some expression that includes (lambda ...) but produces a value that is not a function. • Do not solve the problem of encrypting letters by using a cond which has 26 (or more) question/answer pairs - one for each letter of the alphabet.
Question 2: Encoding Cryptography is the study of trying to create secure information by obscuring the original message. One simple encryption method is to substitute letters from the original message with other letters. To make it harder to decrypt the hidden message, we may also remove clues such as the length of the words in the message and any punctuation or capitalization. Write a function encode that consumes a string message. The function produces a string which is encrypted according the following procedure: • Only the letters from the original message will be encrypted. Other characters such as spaces, punctuation, numeric digits, etc. are not included in the encrypted message at all. • The encrypted message will only contain uppercase letters. • Each letter will be replaced by the uppercase letter at the opposite end of the English alphabet. In other words, A or a will become z, B or b will become Y, C or c will become x, .., z or z will become A. • The encrypted message will have a single space separating each letter. You may assume that the letters in message are English letters only. For example: > (encode "Cat") 2 "X Z G" |> (encode "A")| 1 4 " > (encode "Is this correct?") 6 "R H G SRH XLII V X G" Additional Restrictions • For this question you are only allowed to define one named function: encode. You may define local constants. There will be severe correctness mark penalties for solutions that include any named helper functions. • You may use lambda expressions in your solution within the application of other functions. However remember that an expression like this: (define function (lambda ...)) is defining a named function. Any lambda expressions in your solution should only appear as part of some expression that includes (lambda ...) but produces a value that is not a function. • Do not solve the problem of encrypting letters by using a cond which has 26 (or more) question/answer pairs - one for each letter of the alphabet.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education