Assignment 112
import java.util.Scanner;
public class OdometerLoops
{
public static void main( String[] args ) throws Exception
{
Scanner keyboard = new Scanner(System.in);
System.out.print("Enter a base to count in (2-10): ");
int base = keyboard.nextInt();
System.out.println();
for ( int thous=0; thous<base; thous++ )
for ( int hund=0; hund<; hund++ )
for ( int tens=0; tens<; tens++ )
for ( int ones=0; ones<; ones++ )
{
System.out.print( " " + thous + "" + hund + "" + tens + "" + ones + "\r" );
Thread.sleep(200);
}
System.out.println();
}
}
//Removing the brackets from the outer for loops does not affect the program.