Assignemnt #40
Code
/// Name: Daniel Nguyen
/// Period: 6
/// Program Name: ModulusAnimation Program
/// File Name: ModulusAnimation.java
/// Date Finished: 9/9/2015
public class ModulusAnimation
{
public static void main( String[] args ) throws Exception
{
for ( int i=0; i<80; i++ )
{
if ( i%10 == 0 ) {
System.out.println("|==================|");
System.out.println("| o |");
System.out.println("| |");
System.out.println("| |");
System.out.println("| |");
System.out.println("|==================|\r");
}
else if ( i%10 == 1 ) {
System.out.println("|==================|");
System.out.println("| |");
System.out.println("| o |");
System.out.println("| |");
System.out.println("| |");
System.out.println("|==================|\r");
}
else if ( i%10 == 2 ) {
System.out.println("|==================|");
System.out.println("| |");
System.out.println("| |");
System.out.println("| o |");
System.out.println("| |");
System.out.println("|==================|\r");
}
else if ( i%10 == 3 ) {
System.out.println("|==================|");
System.out.println("| |");
System.out.println("| |");
System.out.println("| |");
System.out.println("| o |");
System.out.println("|==================|\r");
}
else if ( i%10 == 4 ) {
System.out.println("|==================|");
System.out.println("| |");
System.out.println("| |");
System.out.println("| |");
System.out.println("| _ |");
System.out.println("|==================|\r");
}
else if ( i%10 == 5 ) {
System.out.println("|==================|");
System.out.println("| |");
System.out.println("| |");
System.out.println("| o |");
System.out.println("| |");
System.out.println("|==================|\r");
}
else if ( i%10 == 6 ) {
System.out.println("|==================|");
System.out.println("| |");
System.out.println("| o |");
System.out.println("| |");
System.out.println("| |");
System.out.println("|==================|\r");
}
else if ( i%10 == 7 ) {
System.out.println("|==================|");
System.out.println("| o |");
System.out.println("| |");
System.out.println("| |");
System.out.println("| |");
System.out.println("|==================|\r");
}
Thread.sleep(200);
}
}
}
Picture of the output