Repetition ... Definite Loop

for-loop: definite loop



Description

This program illustrates repetition... looping. It builds on the previous program showing if-then-else statements.

It illustrates these new concepts:

  1. for loop, a definite loop structure in which the execution of some collection of program statements is repeated a specific number of times.

Input

For each repetition, the program will ask the user to type a number. There will be exactly 3 repetitions (so the user will eventually type 3 numbers).

Output

For each repetition, the program will report if the input number is less than 100, and if so it will produce a result twice the input value. If the input number is 100 or more, it will report that, and produce a result that is 20 larger than the input.

With 3 repetitions, we will see this output done 3 times.

Termination

The program terminates automatically after 3 cycles of the input/output behavior.