C:\Users\notebook\Documents\NetBeansProjects\CS2\src\review\LetterLines.java
 1 /*
 2  * Program to:
 3  * Print 30 Lines of letters.
 4  * For each letter, a random integer n between 1 and 26 inclusive is generated.
 5  * The nth letter of the alphabet is then printed n times on one line.
 6  */
 7 package review;
 8 
 9 import java.util.Random;
10 
11 
12 /**
13  *
14  * @author notebook
15  */
16 public class LetterLines {
17 
18     static String letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
19 
20     /**
21      * @param args the command line arguments
22      */
23     public static void main(String[] args) {
24         int a = 1;
25         while (a <= 30) {
26             Random random = new Random();
27             int rgen = random.nextInt(26);
28             String alphabet = letters.substring(rgen, rgen+1);
29             for (int x = 1; x <= rgen+1; x++) {
30                 System.out.print(alphabet);
31             }
32             System.out.println();
33             a = a + 1;
34         }
35     }
36 
37 }
38