Pattern JAVA

Create a class named Problem1, the program would do the following: – The program should have a main method, for now just leave it empty. Create a method named boxWithMinorDiagonal which takes one integer n as parameter, and doesn’t return any value, the method should print an n-by-n empty box of asterisks with the minor diagonal of’+’ symbols. e.g, when n = 9 the method would display: * * * * * * * ** * * * * + * * * * * * * * * * + * ******** * Create a method named right Triangle which takes one integer n as parameter, and doesn’t return any value, the method should print right triangle of asterisks. e.g, when n = 9 the method would display: * * * * * * * * * * * * * * * * * * * ** * ** * * Create a method named printNLetter which takes one integer n as parameter, and doesn’t return any value, the method should print an n-by-n letter N of asterisks. e.g, when n = 9 the method would display: * * * * * * * * * * * * * * * * * * * * * * * * * * * Create a method named fancy Square which takes one integer nas parameter, and doesn’t return any value, the method should print an n-by-n shape shown below. e.g, when n = 9 the method would display: @******* *+ +* * + + * * + + * * @ * * + + * * + + * *+ +* @******* – Create a method named plusInSquare which takes one integer n as parameter, and doesn’t return any value, the method should print an n-by-n shape shown below. e.g, when n = 9 the method would display: XXXXXXXXX X…+…x X…+…x X…+…X X+++++++X X…+…X X…+…x X…+…X XXXXXXXXX Go back to the main method and prompt the user to enter an integer n. The value of n must be an odd integer and greater than or equal 5. Call the methods created above and pass the integer n as an argument to those methods. Your methods should work for any integer n, so DO NOT hard code the print statements. – Copy the output to a text file named Problem1.txt

×
New Download