A22.0002
Homework assignment #5

Due: Wednesday, June 16th



Write a program that produces block letters for the following letters which will be read into your program: A, B, C, E, F, G, H, I, J, L, O, P, S, T, or U.

Note that A, B, C, E, F, G, H, J, L, O, P, S, or U are simpler than I & T because they are made out of vertical lines only on the far right and the far left. . You should define the letters by writing the appropriate procedures calls in your main program.

For example, the letter A would be formed by procedure ProcA as follows:

**********
*        *
*        *
*        *
*        *
**********
*        *
*        *
*        *
*        *
where procedure HorizLine would produce **********; and VertLines, would produce:
*        *
*        *
*        *
*        *
Thus ProcA would be written as:
ProcA;
BEGIN
    HorizLine;
    VertLines;
    HorizLine;
    VertLines
END;

On the other hand, the letter "H" would be produced by the following sequence:

 VertLines; 
 Horizline;
 VertLines; 

Letters C, E, F, G, I, J, L, P, S, and T will need to use a special procedure called Line(M:Integer);

For example, the letter T would be formed by procedure ProcT as follows:


***********
     *
     *
     *
     *
     *
     *
     *
     *
where Line(6) would produce:
      *
      *
      *
      *
Thus ProcT would be written as:
procedure ProcT;
    HorizLine;
    Line(6);
    Line(6);
    writeln
END;

Thus if the procedure heading for Line is procedure line(m:integer); then you should use m as the field width for printing the *. Your program should use procedure Line to produce C, E, F, G, I, J, L, P, S, and T. Your program should read a line of letters until you reach EOLN, and pass each of these letters, one at a time, as a value parameter to a procedure. By using IF statements or a CASE statement this procedure should call the procedure that generates the appropriate letter. All the letters should be the approximately the same height. Convert all letters to upper case. If you find a character on input which you do not handle, print out a square of stars:

***********
***********
***********
***********
***********
***********
***********
***********
***********
***********
***********