Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
Members have full access to the forums. Advertisements are removed for registered users.
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.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.