Assignment help - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Assignment help

gxShadowgxShadow Posts: 2Member
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.

Comments

  • zibadianzibadian Posts: 6,349Member
    : 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.
    [code]
    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;
    }
    }
    [/code]
  • gxShadowgxShadow Posts: 2Member
    [b][red]This message was edited by gxShadow at 2006-8-29 7:47:54[/red][/b][hr]
    : : 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.
    : [code]
    : 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;
    : }
    : }
    : [/code]
    :
    Thanks, that helped allot
  • ajimajim Posts: 5Member
    Hello friends, this is ajim..[b]Acropolismentors[/b][link=http://www.acropolismentors.com/][/link] 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.

  • ajimajim Posts: 5Member
    Hello friends, this is ajim..[b]Acropolismentors[/b][link=http://www.acropolismentors.com/][/link] 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.
Sign In or Register to comment.