Assignemnt #40: Modulus Animation
Code
/// Name: Cassie
/// Period: 6
/// Program Name: Modulus Animation
/// File Name: ModAnimation.java
/// Date Finished: 11/10/2015
class ModAnimation
{
public static void main( String[] args ) throws Exception
{
for ( int i=0; i<50; i++ )
{
if ( i%18 == 0 )
System.out.print("I like puppies! \r");
else if ( i%18 == 1 )
System.out.print(" like puppies! \r");
else if ( i%18 == 2 )
System.out.print("like puppies! I\r");
else if ( i%18 == 3 )
System.out.print("ike puppies! I \r");
else if ( i%18 == 4 )
System.out.print("ke puppies! I l\r");
else if ( i%18 == 5 )
System.out.print("e puppies! I li\r");
else if ( i%18 == 6 )
System.out.print(" puppies! I lik\r");
else if ( i%18 == 7 )
System.out.print("puppies! I like\r");
else if ( i%18 == 8 )
System.out.print("uppies! I like \r");
else if ( i%18 == 9 )
System.out.print("ppies! I like p\r");
else if ( i%18 == 10 )
System.out.print("pies! I like pu\r");
else if ( i%18 == 11 )
System.out.print("ies! I like pup\r");
else if ( i%18 == 12 )
System.out.print("es! I like pupp\r");
else if ( i%18 == 13 )
System.out.print("s! I like puppi\r");
else if ( i%18 == 14 )
System.out.print("! I like puppie\r");
else if ( i%18 == 15 )
System.out.print(" I like puppies\r");
else if ( i%18 == 16 )
System.out.print(" I like puppies!\r");
else if ( i%18 == 17 )
System.out.print("I like puppies! \r");
Thread.sleep(200);
}
}
}
Picture of the output