The homework assignment says:
24. Write a program that inputs N, where 3 <= N <= 25, and outputs a cross. The following figure shows the output when N is 5.
I found this
thread that seems to be trying to do the same that I am, but I'm running into the problem where the middle/center character of the cross is off a little bit. I don't think it matters when I turn the assignment in, but it was bugging me and I wanted to know if there were ways to fix it. I've looked into formatting a little bit with Dates and DecimalFormat, but I'm not sure how I would implement it here. Any tips would be appreciated. Also as a side note I think I picked up on what marc weber was hinting at, in the
thread, with the second half of the "if statement", but I'm wondering did I get it right?
Here's my code:
Output: