So I have a question I'm trying to solve. I am supposed to display four patterns using loops. I have the coding for each pattern, but is there a way to have them all in the same .java file? Here's my code:
When I run, I can only do the output for the first pattern. I just don't know how to go about combining them. Is there a way to do all of them without separating each into their own file/project? Thanks.
Please read this, which is on the contents page of this forum:-
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
By providing a complete solution you are depriving the OP of the opportunity to learn from this experience; also if this is assessed work there is a risk OP will be accused of plagiarism and get a mark of 0.
Please don't get annoyed, but I have pulled rank and deleted the solution, except one part which regular readers will doubtless see in a few seconds will fail to “work”.