297,402 views
30 votes
30 votes
Write a recursive function encode that takes two Strings as an input. The first String is the message

to be encoded and the second String is the key that will be used to encode the message. The function
should check if the key and message are of equal length. If they are not the function must return the
string “Key length mismatch!” Otherwise the function must get the ASCII value of each character in
the key string and check if it is divisible by 2 if it is then the respective character in the message will be
encoded by getting the ASCII value of that character and adding 5. If corresponding key character it is
not divisible by 2 then 3 is added instead. Can someone help please

User Slsy
by
2.5k points

1 Answer

12 votes
12 votes

Answer:

85

Step-by-step explanation:

jdjdjdjfjfjcjjcjrtgtggtfg g hi i

User Arto
by
3.0k points