Code
/// Name: Afaf Nabeeha
/// Period: 7
/// Program Name: Modulus Animation
/// File Name: Modulus.java
/// Date Finished: 11/4/2015 public class Modulus
public class Modulus
{
public static void main( String[] args ) throws Exception
{
for ( int i=0; i<80; i++ )
{
if ( i%40 == 0 )
System.out.print("C \r");
else if ( i%40 == 1 )
System.out.print("CO \r" );
else if ( i%40 == 2 )
System.out.print("COM\r" );
else if ( i%40 == 3 )
System.out.print("COMP\r" );
else if ( i%40 == 4 )
System.out.print("COMPU \r" );
else if ( i%40 == 6 )
System.out.print("COMPUT \r" );
else if ( i%40 == 7 )
System.out.print("COMPUTE \r" );
else if ( i%40 == 8 )
System.out.print("COMPUTER \r" );
Thread.sleep(200);
}
}
}
Picture of the output