201801examen en
201801examen en
2. Develop an algorithm in Java that declares and initializes an array of 200 char, assigns a random
character between 'a' and 'z' (lowercase letters) in every position and performs this sequential process:
print the pairs of characters formed by a vowel followed by the letter 'm' and the index where the first
letter of the two letters was found. In example,
Fragment of the array of 200 char Fragment of the output of the program
… 25 26 27 28 29 30 31 32 33 … ...
a m 26
… s a m h e f m u m … u m 32
...
Modularity, clarity and explanation of the solution will be assessed. (1 hour, 3.5 points)
3. An homohemigram is defined as a word formed by two groups of letters that are exactly the same, in
other words, the first half of the word is identic to the second part. In example: bonbon, coco, meme,
chichi.
Develop a program in Java that, given a file words.txt that contains a word in each line, writes in the
file homohemigrams.txt the words of that type that can be found in the first, one in each line.
It is required to define and use the Word class and any other that is considered needed to solve the
exercise. It is forbidden to use the class String for anything else than input/output operations.
Modularity, descendent design, clarity and explanation of the solution will be assessed. (1.30 hours,
4.5 points)