CIS071 Lab06 (Extra Credit)  - Drawing a Diamond            DUE: (Friday, Mar 03, NOON)


Drawing a Diamond

 

Write a program which, given an integer k greater than or equal to 3, prints a diamond of height and width (in the middle) equal to k.

 

For example, for k = 5, print

 

   *

  ***

 *****

  ***

   *

 

For k = 6, print

 

   **

  ****

 ******

 ******

  ****

   **

 

HINT: You might find it useful to write two lower level functions, one to draw a solid inverted wedge with a base of width w:

 

        *

       ***

      *****

 

and the other to draw a wedge with top w:

 

       ***

        *