Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Named Arguments [2/9]

Named arguments x and y of println statement change the position of text on the screen.
[Run the program]

Named arguments must be specified before other arguments in a println statement.

Exercises:

1. Un-comment the last line of the program. To un-comment it, remove the two initial symbols << . [Run the program]

2. Add a statement such that the program also displays the result of expression 7*8 at position (100, 400).

3. Add a statement such that the program also displays the result of expression 22/3 at position (200, 400) in orange color. The foreground color can be set by the named argument fg.

  • To track how far you have progressed, click on the 'Overview' button at the top left menu.
  • Remember to do some regular breaks from your learning journey.

Loading...