A22.0002
Homework assignment #6

 

Write another 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. You have already done some of these letters in Assignment #4.

However, now letters C, E, F, G, I, J, L, P, S, and T should all use a special procedure called Line(M:Integer) to handle single vertical "lines".

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:

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