Assignemnt #115
Code
/// Name: Connor Siri
/// Period: 7
/// Program Name: Nest
/// File Name: Nest.java
/// Date Finished: 2/29/2016
public class Nest
{
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.println("");
}
System.out.println("\n");
} //the variable n changes much faster, changes 3 times more
//the output changes by counting number then character
//the output changes by showing the number pairs vertically
//the output changes by making a new line everytime b counts to 3
}
Picture of the output