Assignment #111 NestedLoops

Code

    
    /// Name: Lacey Reese 
    /// Period: 5
    /// Program Name:  NestedLoops
    /// File Name:  NestedLoops.java
    /// Date Finished 4/25/2016
                     
public class NestedLoops
{
    public static void main( String[] args )
    {
        // this is #1 - I'll call it "CN"
        for ( char c='A'; c <= 'E'; c++ )
        {
            for ( int n=1; n <= 3; n++ )
            {
                System.out.println( c + " " + n );
            }
        }

        System.out.println("\n");

        // this is #2 - I'll call it "AB"
        for ( int a=1; a <= 3; a++ )
        {
            for ( int b=1; b <= 3; b++ )
            {
                System.out.print( a + "-" + b + " " );
            }
            System.out.print( " I love cats till I die " );
        }

        System.out.println("\n");

    }
}

/// 1. The inner loop is the one that changes faster.
    /// 2. The input changes becausethe letter loop changes faster.
    /// 3. The output changes becase it causes each n-n number pair to print on a separate line.
    /// 4. The output changes because it makeds it so that every 3 number pairs "Frog" is printed and it jumps to the next line.



	
    
    

Picture of the output

Assignment 111