Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

BVGS Computing Dept.

Java

Example Program 6 – Iteration

Tasks

1. Adapt the example program so that it displays a count from 1 to 10 not 0 to 9.


2. Investigate and test how to get the program to count from 10 to 1.
3. Write a program which asks for your name and then displays it 5 times on the
screen.
4. Write a program to display the name of the town you live in 10 times.
5. Write a program to ask for a person’s favourite CD and the artist. Both should be
displayed on the same line 5 times.
6. Write a program to ask for a number and display its multiplication table 1 to 100
7. Write a program that asks the user for a number 5 times and adds them all up to
give a total.

You might also like