Hello -- Looking for help with an extra credit assignment to give my grade a needed boost. The program is to display a star pattern with java loops. From prof:

Write a program using loops to display the star pattern that follows the written description. You need to ask the user as to what the number of stars in each row should be (x)? You should also ask the user what number of rows to print (y)? When you get these two inputs start printing ‘x’ stars on each row. When you go to the next row the number of stars will shift right by one space. So the first row will have zero space, the second row will have 1 space, and so on. You will do that till you hit the mid-point. This would be y/2 or y/2+1 depending upon whether y is odd or even. After the mid-point start decreasing the number of spaces on each line as you reach y. Remember that you will have a nice arrow only if the number of rows is odd. Restrict the number of stars to less than 10 and more than 0.

*****
*****
*****
*****
*****
*****
*****
*****
*****

To solve this extra credit assignment and display the star pattern using java loops, you can follow these steps:

1. Prompt the user to enter two integers: the number of stars in each row (x) and the number of rows to print (y). Make sure that x is less than 10 and greater than 0.

2. Determine the midpoint of the star pattern by dividing y by 2. If y is odd, the midpoint is y/2 + 1. If y is even, the midpoint is y/2.

3. Use nested loops to iterate over each row and column of the star pattern.

a. The outer loop controls the rows and iterates from 1 to y.

b. Inside the outer loop, use another loop to print the spaces before the stars. The number of spaces should start from zero and increment by one for each row before the midpoint. After the midpoint, the number of spaces should decrease by one for each row.

c. Inside the inner loop, use another loop to print the stars. The number of stars in each row is equal to x.

d. Print a newline character ("\n") to move to the next row after printing the spaces and stars.

Here's a sample code in Java that implements the logic described above:

```java
import java.util.Scanner;

public class StarPattern {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

System.out.println("Enter the number of stars in each row (less than 10 and more than 0):");
int x = scanner.nextInt();

System.out.println("Enter the number of rows to print:");
int y = scanner.nextInt();

int midpoint = y % 2 == 0 ? y / 2 : y / 2 + 1;

for (int row = 1; row <= y; row++) {
for (int space = 0; space < row - 1 && row <= midpoint; space++) {
System.out.print(" ");
}

for (int star = 0; star < x; star++) {
System.out.print("*");
}

System.out.println();
}
}
}
```

Now, when you run this program and input appropriate values for x and y, it will display the star pattern as desired by your professor.