"Oggi è il mio giorno fortunato. Ho pensato a cinque nuovi compiti per te. Sono pieno di creatività. Buona fortuna, amico mio. Ne avrai bisogno..."
2
Compito
Java Syntax, livello 4, lezione 13
Even numbers
A for loop simplifies the counting, simplifies displaying text, and simplifies... the life of a programmer! And it saves a lot of time: just a couple of simple lines of code and you can display every even number from 1 to 100 inclusive. Let's try it, but be sure to put each value on a separate line.
4
Compito
Java Syntax, livello 4, lezione 13
Drawing a rectangle
Expressive drawing using the modest tools of pseudographics is the same as minimalism in music. At least, some critics on Earth think so. Well, let's heed their words and do some drawing. Let's enter two numbers m and n, and draw a rectangle of eights. The rectangle will be m eights high and n eights wide.
4
Compito
Java Syntax, livello 4, lezione 13
Triangle of eights
Drawing on the console is called "pseudographics". This technique began at the dawn of the computer age and progressed in parallel with ordinary graphics until the beginning of the Windows era. Then it stagnated and faded away. Maybe you daydream about great pseudographics? Let's start mastering the technique by drawing a "triangle of eights".
2
Compito
Java Syntax, livello 4, lezione 13
Drawing lines
Everything starts with lines, including the path of an artist. But the path of a programmer begins with the study of loops. At this point, we need to master the for loop. It is convenient, simple, and helps us create. Let's use it to draw horizontal and vertical lines, consisting of ten 8s each.
2
Compito
Java Syntax, livello 4, lezione 13
Chain letter
Who (or for some people, what) do you see in your sweet dreams? Do you have someone in mind? Make a wish. Write a program that takes a name from the keyboard and displays the phrase " loves me" 10 times. If you do this with a for loop, your wish* will come true (*your wish to become a programmer).