CS112: In-class Exercise 11basic loops1.Create a new project loops-11.2.Create a new class, called TestingLoops. Delete everything but the outer wrapper.3.In this TestingLoopsclass, create the following methods. There are no instance variables for this class. We are just going to write and test methods.•Write a voidmethod, praise(String name, int n)that will print to the Terminal Window n times a nice sentence about name.You decide on the sentence.◊Create a TestingLoops object, and invoke the praisemethod with various inputs.◊For example, invoking praise(“Odie”, 7)might print the sentence “Odie is great.” 7 times. And invoking praise(“Garfield”, 20)might print the sentence “Garfield is adorable.” 20 times. •Write a intmethod, sumUpSquares(int n)that computes and returns an integer that is the sum of the first nsquares. (1 + 4 + 9 + …). This method should be a very simple modification of the sumUpmethod that we did in class.
This is the end of the preview.
access the rest of the document.