subject

Assume the availability of a method named makeStars that can be passed a non-negative integer n and that returns a String of n asterisks. Write a method named printTriangle that receives a non-negative integer n and prints a triangle of asterisks as follows: first a line of n asterisks, followed by a line of n-1 asterisks, and then a line of n-2 asterisks, and so on. For example, if the method received 5 it would print:
* * * * *
* * * *
* * *
* *
*
The method must NOT use a loop of any kind (for, while, do-while) to accomplish its job. The method should invoke printStars to accomplish the task of printing a single line.

It should use recursion and be done in Java.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:40
What are the three parts to physical security standards for various types of army equipment and the risk level
Answers: 2
question
Computers and Technology, 22.06.2019 15:30
Whats are the different parts of no verbal comunication, especially body language?
Answers: 3
question
Computers and Technology, 23.06.2019 01:30
Negative methods of behavior correction include all but this: sarcasm verbal abuse setting an example for proper behavior humiliation
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Plz ( which is an example of a good url?
Answers: 1
You know the right answer?
Assume the availability of a method named makeStars that can be passed a non-negative integer n and...
Questions
question
Arts, 13.12.2020 06:20
question
Mathematics, 13.12.2020 06:20
question
History, 13.12.2020 06:20
question
Mathematics, 13.12.2020 06:20
question
Arts, 13.12.2020 06:30
Questions on the website: 13722361