Question: IN JAVA PLEASE AND THANKS :) Overview This is a short set of practice problems involving writing loops. You will write eight methods for the
IN JAVA PLEASE AND THANKS :)




Overview This is a short set of practice problems involving writing loops. You will write eight methods for the class minil. LoopaholicsAnonymous. All of the methods are static, so your class will not have any instance variables (or any static variables, for that matter). There is a constructor, but it is declared private so the class cannot be instantiated. For details and examples see the online Javadoc. There is a skeleton of the class on Canvas. If you use the skeleton code, be sure you put it in a package called minil. If you are working on findEscapeCount, can you a. work by hand through the example calculation given in the Javadoc, and get the same answers? b. write a loop that has the correct loop body but always just repeats the steps, say, 5 times? c. write a condition to check that a2 + b2 operators.) c. modify your algorithm so that instead of returning the length of the longest run, it returns the starting index of the longest run? d. modify your algorithm so that instead of returning the starting index of the longest run, it returns the actual longest run as a String? If you are working on printStars, can you a. write a helper method that, given a number d, constructs and returns a String of d dashes? b. write a helper method that, given number d and a number n > d, returns a String of the correct form for one line of the output? (For example, given n= 5 and d = 3, return the 10-character string "---* *---" ) c. write an algorithm to just print out the number of dashes that should appear at the beginning of each line? (For example, if n = 5, you'd print 4, 3, 2, 1, 0, 0, 1, 2, 3, 4)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
