Results 1 to 4 of 4
  1. #1
    westbakke is offline Member
    Join Date
    Jun 2011
    Posts
    2
    Rep Power
    0

    Default Where should I start with this program?

    I am taking Comp Sci I at my high school. I have been having trouble recently because we are focusing on OOP now. The final exam is tomorrow, and it would be much appreciated if y'all could help out:

    Write a simple class for a triangle.
    A triangle has side lengths.

    Constructors (default and initialization)
    Accessors
    Modifiers
    Method to calculate the area (find the area of one side height times width then multiply by six)
    toString to output height, base, and area


    Thanks in advance!
    Last edited by westbakke; 06-02-2011 at 02:04 AM.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,762
    Rep Power
    7

    Default

    Follw the instructions.

    "Write a simple class for a triangle."

    Do you know how to write a class? If not then go back and review the basics.

    "A cube has side lengths."

    I'm a little confused here. Are you supposed to write a class for a cube as well?

    "Constructors (default and initialization)"

    Do you know how to write a constructor? If not go back and review the basics. Same goes for the rest: variables, methods etc.

    Make an attempt to write the code. When you get stuck post your code here and ask a specific question. Also remember to copy and paste the EXACT error message if you get any.

  3. #3
    westbakke is offline Member
    Join Date
    Jun 2011
    Posts
    2
    Rep Power
    0

    Default

    Thanks for the reply. I'll try to make this program and I'll post the results. Also that was a typo, I meant to say triangle instead of cube.

  4. #4
    loopsnhoops is offline Member
    Join Date
    Feb 2011
    Posts
    83
    Rep Power
    0

    Default

    Is the triangle a graphics related object or are you primarily focused on the method you are making to find the area?

Similar Threads

  1. Confused on how to start this Math program
    By gnng in forum New To Java
    Replies: 3
    Last Post: 04-16-2011, 12:14 AM
  2. Replies: 1
    Last Post: 01-18-2011, 06:27 PM
  3. Need help on how to start off with a program
    By javanoobie in forum New To Java
    Replies: 6
    Last Post: 03-23-2009, 11:42 PM
  4. Replies: 5
    Last Post: 03-20-2009, 10:04 PM
  5. Really Stuck on how to Start this program
    By random0munky in forum New To Java
    Replies: 4
    Last Post: 10-29-2008, 08:57 AM

Tags for this Thread

Posting Permissions

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