Question
USE SCHEME LANGUAGE (R5RS) TO SOLVE THIS PROBLEM 1. Using Scheme higher-order function map to implement the string encryption and decrption. [10 points] 1.1 The
USE SCHEME LANGUAGE (R5RS) TO SOLVE THIS PROBLEM
1. Using Scheme higher-order function map to implement the string encryption and decrption. [10 points]
1.1 The encryption function must (1) take the encryption key (key can be between 1 and 4) from the keyboard using (read); and (2) encrypt alphabetic characters and digits only. [5]
1.2 The decryption function must (1) take the encryption key from the keyboard using (read) and (2) decrypt the string generated from your encryption function. [5]
Test cases:
(encrypt "Hello CSE240!")
(decrypt "Khoor FVH573!")
3
"Khoor FVH573!"
3
"Hello CSE240!"
Note: When you encrypt a valid character (letters and digits), you add a key to the character. When you decrypt, you will have a different set of the valid characters, which is caused by +key. You can limit the allowed key value to be 1, 2, 3, and 4.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started