Results 1 to 3 of 3
Thread: object manipulation
- 11-15-2011, 10:21 AM #1
Member
- Join Date
- Oct 2011
- Posts
- 11
- Rep Power
- 0
object manipulation
Define a java class called Rectangle representing a rectangle on a Cartesian plane. The Rectangle class should be defined by the following:
Four objects of class Point defined in (a) above representing four corners of a rectangle,
A null arguments constructor ,
A constructor taking in four Point arguments for its corners,
Public methods to return the height, width ,and center Point of a Rectangle object , assuming horizontal or vertical orientation of a rectangle
A boolean method for checking if a rectangle is a square
Java Code:class Rectangle{ public Point w,x,y,z; Rectangle(){ } public double getHeight(){ z = new Point(); w = new Point(); return Point.w-Point.z;} public double getwidth(){ y = new Point(); x = new Point(); return Point.y-Point.x; } }Last edited by pbrockway2; 11-15-2011 at 11:06 AM. Reason: code tags added
- 11-15-2011, 10:58 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: object manipulation
Is there a question in there somewhere?
- 11-15-2011, 11:18 AM #3
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,545
- Rep Power
- 11
Re: object manipulation
Please use "code" tags when posting code. Put [code] at the start of the code and [/code] at the end so that the code appears formatted.
These forums are not a place for dumping your homework. So, please, don't do that.
They *are* a place where you can get help that will allow you to develop understanding and extend your knowledge. But this involves a couple of things: first you do have to ask a question. As Tolls has pointed out there is no question in this thread yet. And, secondly, you do have to engage in dialogue with people who respond to you. That is, you should respond to help they offer or questions they ask - even if it is to say that you don't understand what they have said. So far, in your previous threads, you have been unwilling to do this.
Similar Threads
-
Help with String Manipulation
By RossGoldenstein in forum New To JavaReplies: 2Last Post: 09-28-2011, 04:24 AM -
Code Manipulation
By danthegreat in forum New To JavaReplies: 1Last Post: 09-28-2011, 12:11 AM -
textField manipulation
By Bogdan in forum Advanced JavaReplies: 3Last Post: 12-15-2010, 02:54 AM -
Image Manipulation
By sh100 in forum New To JavaReplies: 0Last Post: 11-03-2009, 10:18 AM -
Array manipulation
By Ms.Ranjan in forum New To JavaReplies: 9Last Post: 07-18-2008, 09:10 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks