TORONTO KIDS COMPUTER CLUB | Markham Saturday 14:00 Java Homework 20.04.25.
17418
post-template-default,single,single-post,postid-17418,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Markham Saturday 14:00 Java Homework 20.04.25.

29 Apr Markham Saturday 14:00 Java Homework 20.04.25.

Problem Description
Jack is trying to invent some new words from old words. For every consonant (consonants are the letters except for a, e, i, o, u) in the old word is replaced by three letters, in the following order:

  • the consonant itself;
  • the vowel closest to the consonant in the alphabet (e.g., if the consonant is d, then the closest vowel is e), with the rule that if the consonant falls exactly between two vowels, then the vowel closer to the start of the alphabet will be chosen (e.g., if the consonant is c, then the closest vowel is a);
  • the next consonant in the alphabet following the original consonant (e.g., if the consonant is d, then the next consonant is f) except if the original consonant is z, in which case the next consonant is z as well.

Vowels in the word remain the same. (Vowels are a, e, i, o, u and all other letters are consonants.)

Write a program that convert a word into a new word.

Input Specification
The input consists of one word entirely composed of lower-case letters. There will be at least one letter and no more than 30 letters in this word.

Output Specification
Output the word as it would be translated into the new word on one line.

Sample Input 1
joy

Output for Sample Input 1
jikoyuz

Sample Input 2
ham

Output for Sample Input 2
hijamon

No Comments

Sorry, the comment form is closed at this time.