// James Brotsos
// james.brotsos@gmail.com
// Sept 25, 2014
// Unit 2 Lab Review
// This program reviews for-loops, nested for-loops and program deconstruction.
// Try to use constants when possible. An example of a constant is:
//
// final int NUMBER_OF_HOURS_IN_DAY = 24;
public class JamesBrotsosUnit2Lab {
public static void main(String[] args) {
forLoopMethod ();
nestedForLoopMethod ();
printPatternMethod ();
}
static void forLoopMethod () {
// Excerise #2, pg 124
// Write a for loop that produces the following output:
// 1 4 9 16 25 36 49 64 81 100
}
static void nestedForLoopMethod () {
// Excerise #6, pg 125
// Write nested for loops to produce the following output:
// 1
// 22
// 333
// 4444
// 55555
// 666666
// 7777777
}
static void printPatternMethod () {
// Excerise #18, pg 127
// Write a program that produces the following output:
// ****** //////////// ******
// ***** //////////\\ *****
// **** ////////\\\\ ****
// *** //////\\\\\\ ***
// ** ////\\\\\\\\ **
// * //\\\\\\\\\\ *
// \\\\\\\\\\\\
// use constant for the number of ROWS
// HINT: you need 6 nested for-loops
// 1. for *
// 2. for " "
// 3. for /
// 4. for \
// 5. for " "
// 6. for *
}
}
No comments:
Post a Comment