Printable View
Did you have a question?
x and y are the co-ordinates of upper left corner and height and width are given as above. It suppose to return perimeter of the rectangle. I could n't find where to start? I know the formula to get Perimeter = 2(height + width) but what do I do with it's coordinate x and y? It should be done with methods so I layout the code structure as you see above. Please give me some ideas on this.
--- Update ---
Yes, I was typing it. It should be up by now.
The x,y are the location of the rectangle. They are not used in computing the perimeter.Quote:
what do I do with it's coordinate x and y
I think this is what you're looking for
********* Code removed Please don't spoonfeed
I got ' r can't be resolved error'; how should I construct Rectangle r?
The formula in your post#3 should work.