Hossein
(Hossein Amerkashi)
October 11, 2019, 11:41am
1
Next Letters
Create a procedure that takes a parameter, modifies it and returns using this algorithm:
Replaces every letter in the string with the next letter in alphabet (e.g. c becomes d, z becomes a).
Checks modified string and determine if it contains vowels (a, e, i, o, u) and if so, capitalizes the vowels.
Examples:
nextLetters(hello3) → Ifmmp 3
nextLetters(fun times!) → gvO Ujnft!
6 Likes
vknow360
(Sunny Gupta)
October 11, 2019, 1:16pm
2
Somehow I am able to do it
4 Likes
Hossein
(Hossein Amerkashi)
October 11, 2019, 2:00pm
5
Great job @vknow360 . Also, take a look at below. Does that give you (or others) idea for other possible solutions?
1 Like
Hossein
(Hossein Amerkashi)
October 11, 2019, 3:38pm
7
@Italo Block below is only for purpose of illustration and needs fine-tuning.
Basically, lookup the character in list1 . If it exists, using FOUND-index, get its associated entry in list2 Notice that list2 is one-off from list1
2 Likes
Italo
(Italo)
October 11, 2019, 3:42pm
8
Very clever solution!
Also I didn’t think of using look up in pairs. It allows you to change the coding to something totally random every time you want.
I also like how @vknow360 coded a whole procedure without using the look up in pairs block. It helps develop the coding skills.
3 Likes
Hossein
(Hossein Amerkashi)
Closed
November 10, 2019, 3:42pm
9
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.