Java

Moderators: zibadian
Number of threads: 7836
Number of posts: 18235

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Assignment help Posted by gxShadow on 28 Aug 2006 at 5:53 PM
I am having trouble with part of my java project I have to do during the summer.I was able to complete one of the assignments, but not the second one. I was wondering if any of you could help me with the following assignment:

A trapezoid is a geometric shape that has four sides. Two of these are parallel and are called the bases of the trapezoid. The height is the distance between the bases. Define a Trapezoid class that encapsulates the height and the length of each base. Provide a constructor that initializes these instance variables. Provide one instance method that calculates the area of the shape. The area equals 0.5 *height *(base1+base2). Instantiate an object of this class and invoke its method.
Report
Re: Assignment help Posted by zibadian on 29 Aug 2006 at 12:46 AM
: I am having trouble with part of my java project I have to do during the summer.I was able to complete one of the assignments, but not the second one. I was wondering if any of you could help me with the following assignment:
:
: A trapezoid is a geometric shape that has four sides. Two of these are parallel and are called the bases of the trapezoid. The height is the distance between the bases. Define a Trapezoid class that encapsulates the height and the length of each base. Provide a constructor that initializes these instance variables. Provide one instance method that calculates the area of the shape. The area equals 0.5 *height *(base1+base2). Instantiate an object of this class and invoke its method.
:
Here's a start. There are several things which you need to write, but that shouldn't be too difficult.
public class Trapezoid {

  private int topBase;
  private int bottomBase;

  public Trapezoid(int base1, int base2) {
    super;
    setToBase(base1)
    // Add additional initializations
  }

  public int getTopBase() {
    // write yourself
  }
  public void setTopBase(int value) {
    // write yourself
  }
  // Add also access methods for bottomBase

  public double getArea() {
    // Perform calculation and return result;
  }
}

Report
Re: Assignment help Posted by gxShadow on 29 Aug 2006 at 7:47 AM
This message was edited by gxShadow at 2006-8-29 7:47:54

: : I am having trouble with part of my java project I have to do during the summer.I was able to complete one of the assignments, but not the second one. I was wondering if any of you could help me with the following assignment:
: :
: : A trapezoid is a geometric shape that has four sides. Two of these are parallel and are called the bases of the trapezoid. The height is the distance between the bases. Define a Trapezoid class that encapsulates the height and the length of each base. Provide a constructor that initializes these instance variables. Provide one instance method that calculates the area of the shape. The area equals 0.5 *height *(base1+base2). Instantiate an object of this class and invoke its method.
: :
: Here's a start. There are several things which you need to write, but that shouldn't be too difficult.
:
: public class Trapezoid {
: 
:   private int topBase;
:   private int bottomBase;
: 
:   public Trapezoid(int base1, int base2) {
:     super;
:     setToBase(base1)
:     // Add additional initializations
:   }
: 
:   public int getTopBase() {
:     // write yourself
:   }
:   public void setTopBase(int value) {
:     // write yourself
:   }
:   // Add also access methods for bottomBase
: 
:   public double getArea() {
:     // Perform calculation and return result;
:   }
: }
: 

:
Thanks, that helped allot
Report
Re: Assignment help Posted by ajim on 7 Feb 2013 at 2:34 AM
Hello friends, this is ajim..Acropolismentors are one of best in giving assignment help online. Their experts are very knowledgeable and give satisfactory results to us with their experiences. All their experts are so very highly qualified.

Report
Re: Assignment help Posted by ajim on 7 Feb 2013 at 2:58 AM
Hello friends, this is ajim..Acropolismentors are one of best in giving assignment help online. Their experts are very knowledgeable and give satisfactory results to us with their experiences. All their experts are so very highly qualified.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.