Assignment #40: Modulus Animation
Code
/// Name: Kiran O'Farrell
/// Period: 7
/// Program name: Modulus Animation
/// File Name: ModulusAnimation.java
/// Date Finished: 11/17/15
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("<");
Thread.sleep(200);
}
else if ( i%10 == 1 ) {
System.out.println("<-");
Thread.sleep(200);
}
else if ( i%10 == 2 ) {
System.out.println("<--");
Thread.sleep(200);
}
else if ( i%10 == 3 ) {
System.out.println("<---");
Thread.sleep(200);
}
else if ( i%10 == 4 ) {
System.out.println("<----");
Thread.sleep(200);
}
else if ( i%10 == 5 ) {
System.out.println("<---->");
Thread.sleep(200);
}
else if ( i%10 == 6 ) {
System.out.println("<----");
Thread.sleep(200);
}
else if ( i%10 == 7 ) {
System.out.println("<---");
Thread.sleep(200);
}
else if ( i%10 == 8 ) {
System.out.println("<--");
Thread.sleep(200);
}
else if ( i%10 == 9 ) {
System.out.println("<-");
Thread.sleep(200);
}
}
}
}
Picture of the output