Menu

(Solved) : 3 Pattern Specification Program Reads Single Integer User Integer Less 1 Prints Message In Q37239316 . . .

3 Pattern Specification The program reads a single integer from the user. If that integer is less than 1, it prints the messa

I need a Java program that uses recursion to do thefollowing

3 Pattern Specification The program reads a single integer from the user. If that integer is less than 1, it prints the message “Input is less than1 and stops. Don’t ask for a better value. Stop. Otherwise, it prints a pattern of integers as demonstrated in the table below. Print a newline after reading the input and before printing the answer. Print another newline after printing the answer. There is a space before each integer, a newline after each integer greater than 5, and the underlines and boldface are hints to help you see that pattern and are not printed by your program. Your program should work for any positive integer, but because it prints 21 numbers (plus spaces) for input n, do not test it with anything bigger than 15. what is printed n 1 213121 This produces a numeric pattern symmetric about n where each half before and after n is also symmetric around n. The newline after printing any integer larger than 5 provides a nice line length and also makes the pattern of the bigger numbers along the right edge reading down. If you get the normal pattern, that will just happen. Don’t think about it. Output for an input of 7 is: 1 2131 214121 31 21512131 214 1 213 121 6 1 2131 21412131 21512131 214 1 213 121 7 1 213 121412131 21512131 2141 213 121 6 1 213 1214121312151 2131 2141 213 12 1 This program must not contain a loop Show transcribed image text 3 Pattern Specification The program reads a single integer from the user. If that integer is less than 1, it prints the message “Input is less than1 and stops. Don’t ask for a better value. Stop. Otherwise, it prints a pattern of integers as demonstrated in the table below. Print a newline after reading the input and before printing the answer. Print another newline after printing the answer. There is a space before each integer, a newline after each integer greater than 5, and the underlines and boldface are hints to help you see that pattern and are not printed by your program. Your program should work for any positive integer, but because it prints 21 numbers (plus spaces) for input n, do not test it with anything bigger than 15. what is printed n 1 213121 This produces a numeric pattern symmetric about n where each half before and after n is also symmetric around n. The newline after printing any integer larger than 5 provides a nice line length and also makes the pattern of the bigger numbers along the right edge reading down. If you get the normal pattern, that will just happen. Don’t think about it. Output for an input of 7 is: 1 2131 214121 31 21512131 214 1 213 121 6 1 2131 21412131 21512131 214 1 213 121 7 1 213 121412131 21512131 2141 213 121 6 1 213 1214121312151 2131 2141 213 12 1 This program must not contain a loop

Expert Answer


Answer to 3 Pattern Specification The program reads a single integer from the user. If that integer is less than 1, it prints the …

OR