CS112: Homework #51.Create a new project loops-hw5.2.Create a new class, called FunWithLoops. Delete everything but the outer wrapper.3.Random Praise. In the FunWithLoopsclass, create the following method. There are no instance variables for this class. We are just going to write and test methods.•Write a voidmethod, randomPraise(String name, int n)that will print to the Terminal Window n times a nice sentence about name.The nice sentence will be picked randomly from a set of say 3 sentences. Here is how you pick the random phrase.◊Generate a random number from 1 to 3, save it in a local variable. (See how this was done in the Die example.)◊Make another local String variable. Use a big if statement so that depending on what the random number was, you set this String variable to a certain phrase.◊Then print that phrase to the screen using a loop.4.Reminder: In Java, multiplication is the asterisk * and division is /.5.A power function. In the FunWithLoopsclass, create the following method. There are no instance variables for this class. We are just going to write and test methods.
This is the end of the preview.
access the rest of the document.