V22.0002
Homework assignment #6

Due: Monday, June11th



Write a program that produces block letters for the following letters which could be read into your program: A, B, C, E, F, G, H, I, J, L, O, P, S, T, or U. You will read and translate one line of character input until EOF (Control-Z) is read.

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 write a function for each letter, and each letter should be made out of a series of function calls for the various strokes it takes to make that letter.

For example, the letter A would be formed by function FunA as follows:

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

In turn, the function for creating an A is made up of calls to two functions that create horizontal and verticals lines. That is, function HorizLine would produce

 

**********

and VertLines, would produce:

*        *
*        *
*        *
*        *
Thus FunA would be written as:
void FunA(void) {
    HorizLine();
    VertLines();
    HorizLine();
    VertLines();

    printf("\n");
}

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 function called Line(int m);

For example, the letter T would be formed by function FunT as follows:


***********
     *
     *
     *
     *
     *
     *
     *
     *
where Line(6) would produce:
      *
      *
      *
      *
Thus FunT would be written as:
void FunT (void);
    HorizLine();
    Line(6);
    Line(6);
    printf("\n");
END;

If the function heading for Line is void line(int m); then you should use m to figure out how many spaces the "*" should be shifted over. Your program should use function 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 EOF (i.e., Control-Z), and pass each of these letters, one at a time, as a value parameter to a function. By using a SWITCH statement, this function should then call the function 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 (the default case in the SWITCH statement), print out a square of stars:

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