Results 1 to 3 of 3
  1. #1
    luciawashaya is offline Member
    Join Date
    Oct 2011
    Posts
    11
    Rep Power
    0

    Default 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

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,006
    Rep Power
    20

    Default Re: object manipulation

    Is there a question in there somewhere?

  3. #3
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default 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

  1. Help with String Manipulation
    By RossGoldenstein in forum New To Java
    Replies: 2
    Last Post: 09-28-2011, 04:24 AM
  2. Code Manipulation
    By danthegreat in forum New To Java
    Replies: 1
    Last Post: 09-28-2011, 12:11 AM
  3. textField manipulation
    By Bogdan in forum Advanced Java
    Replies: 3
    Last Post: 12-15-2010, 02:54 AM
  4. Image Manipulation
    By sh100 in forum New To Java
    Replies: 0
    Last Post: 11-03-2009, 10:18 AM
  5. Array manipulation
    By Ms.Ranjan in forum New To Java
    Replies: 9
    Last Post: 07-18-2008, 09:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •