Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

The Type string [14/14]

This program slowly outputs the text of the song.

The break statement ends the current loop.

In this program, the break statement is used to end the while loop when the entire song has been printed out.

The getter .floor from type num was explained in the previous chapter. It converts a number to type int.

After running and analyzing this program, try modifying the literal 20 in the expression that sets the initial value of variable n. Find out what property of the program is affected by this literal.

After that, use a println statement at the end of the loop to print out the value of variable n.

After that, use a named argument ln to set the particular printout line, for example line 17.

After that, use a println statement to print out the value of variable lineA before the loop. Don't forget to use a sleepMs function afterwards, otherwise this printout will get immediately deleted. After that , use a println statement to print out the value of variable lineB before the loop.

Loading...