43.9k views
3 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 Mohitp
by
6.0k points

1 Answer

2 votes

Answer:

85

Step-by-step explanation:

jdjdjdjfjfjcjjcjrtgtggtfg g hi i

User Subbaraoc
by
5.7k points