+ 1
Writing lettet M using for for loops and switch
The height of letter M is determine by for loop. Use switch and System.out.println("* *"); System.out.println("* * * *"); System.out.println("* * *"); System.out.printlin("* * *"); to print stars. You basically have a simple solution. Their advance solutions much more complicated.
4 ответов
+ 1
that is absolutely correct
+ 1
that is absolutely correct
+ 1
hy xan I am teddy department of software engineering. .nice to meet you
0
Here's the 'simple' version, which implements the version you specified:
https://code.sololearn.com/chVdU1Dc3R0W/#java
Here's a more complicated version that creates a canvas made out of characters. Any lines can be drawn to the canvas (drawn as asterisks). I currently draw 4 lines, representing a capital letter M. Note that this code doesn't have good enough error checking yet! It is just to give an idea of what is possible.
https://code.sololearn.com/cLYRWvV9vDM3/#java
This took me several hours to do! I really enjoyed the challenge! :-)
Let me know if you have any questions.