Assignemnt #112 and Odometer Loops
Code
///Name: Daniel Tiffany-Appleton
///Period: 7
///Program Name: Odometer Loops
///File Name: OdometerLoops
///Date Finished: 3/21/16
import java.util.Scanner;
public class OdometerLoops
{
public static void main( String[] args ) throws Exception
{
Scanner keyboard = new Scanner(System.in);
int base;
System.out.print("Which base (2-10): ");
base = keyboard.nextInt();
//base = base - 1;
for ( int thous=0; thous< base; thous++ )
for ( int hund=0; hund< base; hund++ )
for ( int tens=0; tens< base; tens++ )
for ( int ones=0; ones< base; ones++ )
{
System.out.print( " " + thous + "" + hund + "" + tens + "" + ones + "\r" );
Thread.sleep(500);
}
System.out.println();
//Yes, it still works.
}
}
Picture of the output