Free University of Bolzano/Bozen
Faculty of Computer Science - Bachelor in Applied Computer Science
Bachelor in Production Engineering
Introduction to Programming - A.A. 2004/2005

Exercise
Functionalities on strings


Exercise 1

Write a public static Java method that receives as parameters a string s and a character c, and returns the string obtained from s by substituting each occurrence of a vocal with c.

For example, given the string "pippo" and the character 'e', the method should return the string "peppe".


Exercise 2

Write a public static Java method that receives as parameter a string s and returns the string obtained by concatening s with s inverted.

For example, given the string "pippo", the method should return "pippooppip".