Assignemnt #112 and Odometer Loops
Code
/// Name: David Shkolnikov
/// Period: 6
/// Program Name: Odometer Loops
/// File Name: OdometerLoops.java
/// Date Finished: 5/4/2016
import java.util.Scanner;
public class OdometerLoops
{
public static void main( String[] args ) throws Exception
{
Scanner bunnys = new Scanner(System.in);
int base;
System.out.print("Which Base?????????? (2-10): ");
base = bunnys.nextInt();
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();
//1. Yes.
//2. OK!
//3.
}
}
Picture of the output