Pattern of Stars Listing 6.4 in the text book demonstrates the use of a nested for loop by printing a pattern of asterisks (stars), starting from the least number of stars per row (1) to the most number of stars per row (10). You will modify this program so that it does the following: Asks the user how many rows of stars they want. Prints the stars starting with the least stars per row and ending with the most stars per row, but the stars must be lined up along the right margin instead of the left. (In other words, print a version of the pattern that has been flipped horizontally i.e. along a vertical axis). You will need: An input statement to prompt the user for the number of rows. An assignment statement to store the number of rows. A nested for loop as shown in Listing 6.4 (pg 263). You will need to modify the conditions in some of your for loops to accomplish this task. This time, you will need two for loops nested within the outermost loop. The outer loop will control the number of rows, as in the example. One of the inner loops will control the number of stars per row, again as in the example. You will need to create another for loop that controls the number of spaces per row, to achieve the intended pattern. The spaces need to be printed before each row of stars is printed. Note: The two inner loops do not have to be nested. See the code shell for the intended design. Sample output: Enter the number of rows: 8 * ** *** **** ***** ****** ******* ******** Code Shell //********************************************************* // StarPattern.java // // This is a modified version of the Stars.java program // from Listing 6.4 in the text. //********************************************************* //import Scanner class here public class StarPattern1 { //------------------------------------------------------ // Prints a triangle shape using asterisk (star) // characters. //------------------------------------------------------ public static void main(String[] args) { //Create Scanner variable final int MAX_ROWS = 10; // Replace this constant // with a variable to store // the number of rows //Ask for number of rows //Store in variable for (int row = 1; /*adjust condition*/; row++) { /*insert a for loop here. This one should control the number of spaces before each star*/ for (int star = 1; star <= row; star++) System.out.print(\"*\"); System.out.println(); } } } Solution //import Scanner class here import java.util.Scanner; public class StarPattern1{ public static void main(String[] args) { Scanner input = new Scanner( System.in ); //Create Scanner variable final int MAX_ROWS; System.out.println(\"Enter the number of rows: \"); MAX_ROWS = input.nextInt(); for (int row = 1; row=row;j--){ System.out.print(\" \"); /*insert a for loop here. This one should control the number of spaces before each star*/ } for (int star = 1; star <= row; star++){ System.out.print(\"*\"); } System.out.println(); } } }.