1.1-Introductie-Programmeren

Printing formatted numbers

Difficulty: Filled Filled Outlined

To properly display a large amount of values, it is common to line-wrap them. Line-wrapping is basically hitting the return-key every now and then in order to prevent the text going beyond the visible area.

Create a program that prints a number of values, starting at 1 at running to a user specified maximum. It must wrap the numbers after every 25th number printed.

(Note: To help with the layout we have used the method String.format(..) to print each integer value with additional whitespaces. An example of this can be found in the code.)

Example

Example