filmov
tv
Java Practice It | Exercise 12.7: writeChars | recursion, recursive programming

Показать описание
More practice its:
Problem:
Question:
Write a method writeChars that accepts an integer parameter n and that prints out n characters as follows. The middle character of the output should always be an asterisk ("*"). If you are asked to write out an even number of characters, then there will be two asterisks in the middle ("**"). Before the asterisk(s) you should write out less-than characters (""). After the asterisk(s) you should write out greater-than characters (""). For example, the following calls produce the following output:
Problem:
Question:
Write a method writeChars that accepts an integer parameter n and that prints out n characters as follows. The middle character of the output should always be an asterisk ("*"). If you are asked to write out an even number of characters, then there will be two asterisks in the middle ("**"). Before the asterisk(s) you should write out less-than characters (""). After the asterisk(s) you should write out greater-than characters (""). For example, the following calls produce the following output: