title: An exercise about drawing a rectangle class using the printf function
body: <p>So the problem is the following : </p>
  
  <p>"Write a method for the Rectangle class called draw that draws a rectangle using dashes and vertical bar characters. The following code sequence </p>
  
  <pre><code>Rectangle *myRect = [[Rectangle alloc]init];
  [myRect setWidth : 10 andHeight : 3];
  [myRect draw];
  </code></pre>
  
  <p>Would produce the following output : "</p>
  
  <p>(i cant show you the picture but its a rectangle made out of "-" dashes and "|" bar characters. Dashes are for width and bar characters for height.)</p>
  
  <p>I've started doing the method like this : </p>
  
  <pre><code>{
  int n;
  
  for ( n = 1 ; n &lt;= self.width ; ++n)
      printf ("-");
  
  for ( n = 1 ; n &lt;= self.height ; ++n){
      printf ("\n|");
          }
      printf("\n");
  
  for ( n = 1 ; n &lt;= self.width ; ++n){
      printf ("-");
  }
  </code></pre>
  
  <p>But it seems like its not going to work like that , i cant get it to display the outer (|) lines . Could anyone help me on this one? </p>