Write a recursive method that takes as a parameter a nonnegative integer and gen
ID: 3584299 • Letter: W
Question
Write a recursive method that takes as a parameter a nonnegative integer and generates the following pattern of stars. If the nonnegative inter is 4, then the pattern generated is: **** *** ** * * ** *** **** Also, write a program that prompts the user to enter the number of lines in pthe pattern and ises the recursive method to generate the pattern. For example, specifying the number of lines to be 4 generates the preceding pattern. I need it to be in java language, so far this is what I have that generates the above pattern. However, Im having trouble on the second part of the problem. public class Stars { public void printStars(int num, int ct, boolean desc) { if (desc) { for (int i=0; iExplanation / Answer
void yourMethod(int first, int starsToWrite, bool add) { if (starsToWriteRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.