So the problem is the following :
"Write a method for the Rectangle class called draw that draws a rectangle using dashes and vertical bar characters. The following code sequence
Rectangle *myRect = [[Rectangle alloc]init];
[myRect setWidth : 10 andHeight : 3];
[myRect draw];
Would produce the following output : "
(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.)
I've started doing the method like this :
{
int n;
for ( n = 1 ; n <= self.width ; ++n)
printf ("-");
for ( n = 1 ; n <= self.height ; ++n){
printf ("\n|");
}
printf("\n");
for ( n = 1 ; n <= self.width ; ++n){
printf ("-");
}
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?