1
$ #
1 $ 1
# 1 1 1
$ 1 # 1 $
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
1
$ #
1 $ 1
# 1 1 1
$ 1 # 1 $
Before writing any code, create the algorithm that will print that design. I assume that you want to print.
Once you have that, then try writing the code.
If you have problems writing the code for the algorithm, post the algorithm and ask questions about the problems you are having with writing code for it.
If you don't understand my answer, don't ignore it, ask a question.
Ok, Do you see any pattern in what is printed line by line?I don't know the algorithm
I don't see any pattern. I'll leave it to you to find the algorithm.
This is not a java programming problem until you have the algorithm and are ready to write the java code for it.
If you don't understand my answer, don't ignore it, ask a question.
If you print a triangular pattern from 1 -15, all the dollars and hashes are prime numbers excpet the last one which is 15. So the pattern : 2,3,5,7,11,13,15, with alternating hashes and dollars. The 15 is the only one preventing it from becoming a full on pattern.
P.S : I don't know whether I have posted this in the right place, under "What's wrong with my code?". I am new to this.
Thanks
Last edited by isitcat; June 8th, 2020 at 08:10 AM.
Ok. Now can you define what is to be printed on each line?
If you don't understand my answer, don't ignore it, ask a question.
Sorry,I didn't understand what you mean to say by define.
I meant for you to post a detailed description of what prints on each line and why that value should be printed.
If you don't understand my answer, don't ignore it, ask a question.