CIS 67 Section 1

Assignment Number 1 F2001

Displaying Letters and Simple Geometric Patterns

Handed out: 8/27

Due: As indicated in each section.

  1. Get your Temple University computer account ASAP and start surfing the web. In particular, go to

    www.cis.temple.edu/~ingargio/

    and start learning as much as you can about what is out there. First and foremost, you will need to know how to enter and execute a program using MS-DOS, which is what we will do in next week's lab.

  2. If you do not yet already know how, learn to send and receive e-mail on the web. Send me an e-mail message from your University computer account (or other account) to confirm you know how. Do this by Friday, August 31.

  3. Programming Assignment A – In class we will do a structure chart illustrating the components and component dependencies for this problem. The actual entering, testing and running of the program will be done in lab on Friday, Sept 7th. The program should ask the user for his or her first name and then display a welcoming message.

    Write a program consisting of a series of functions, where each function prints out a block letter (5x5 characters or 7x7 per letter, max) that appears in your initials. [In my case, I would have to write the functions blockF and blockL for the letters F, L. Ex- President Clinton would have three functions for the letters W. J. C. I would also have to write the main program that invokes the block letter functions to vertically print my initials. (I would have to call in order, blockF, blockL, blockF.)]

    Be sure to document the main program and each function. In the main program put, at least, your name, date, class and homework number, statement of problem. In each function, at least a statement of what it does. NOTE: If two of your initials are the same you have less work to do. If you have four initials, you will have to work harder.

  4. Programming Assignment B (Writing Layered Software) -- A structure chart depicting the required components, component dependencies for this program is due in class Wednesday, Sept 5. I addition, a complete function interface for all functions except main is due on Sept 5. The actual entering, testing and running of the program will be done in lab on Friday, Sept 7th. This program is harder than the previous one.

    Write a program to print a set of squares, horizontal lines, and up-side-down Vs to form a rocket ship. Your program should be similar in structure to the program in Part 3 (above), and consist of at least three second level components, one to display an up-side-down V, one to display a horizontal line, and the third to display a square, as shown below as 3x5 graphics:

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

    When you are done, your rocket ship should consist of an up-side-down V on top, followed by three squares, each directly under the other and all directly under the triangle. At the base of the rocket ship should appear an up-side-down V, directly under the bottom square. You may assume that each shape has width 5.

    Hints:

    1. Do not use arrays. Just functions with arguments, ifs, and for loops. There should be no strings of blanks or stars (such as possibly used in the previous program) anywhere in this program.
    2. Your three layer 2 functions (draw_usdv, draw_line, and draw_square) should have a two arguments: 1) indicates the position in current line in which the non-blank character(s) making up the top line of the shape are to begin; 2) indicates the non-blank character to be printed. The start position MUST BE between 1 and 80. KEY ISSUE: Once you know the left most position of the first non-blank of the top line of a shape, you can figure out how to draw the entire shape, regardless of the width and depth. (For the upside-down-V and the square, you can assume the width will be an odd number. How can you test for this? The depth can be assumed to be two less than the width.)
    3. Your three functions should call the same lower level function (one such function will do the trick) which, given a character ch, (a blank or star for this problem), a start position stpos, and a length, len (often 1, but sometimes greater than 1) displays a row of characters, ch, of length len, starting at position stpos.
    4. It is your task, when calling the above functions to determine exactly where each sequence of blanks or stars is to begin to properly form your rocket ship. This beginning point may NEVER be less than one nor greater than 80.