Results 1 to 13 of 13
  1. #1
    Mully is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default Solved

    Solved

    10charlimit
    Last edited by Mully; 03-03-2011 at 05:18 PM. Reason: Solved

  2. #2
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    to help you we need concrete questions about a uml diagram we can see. can you post your questions and the uml diagram?

  3. #3
    Mully is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default

    UML Diagrams:




    The scenario:



    Expected output:


    I think it might be better to speak over an IM, if possible. Probably going to be more efficient this way.
    Last edited by Mully; 03-03-2011 at 03:53 PM.

  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Here would probably be better since it has a lot more eyes on it, a lot of these methods are basic setters and getters, what are you having trouble designing?

  5. #5
    Mully is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default

    The bit im having trouble with is 1. understanding what I actually need to do in each class, and 2. what goes in each method.

  6. #6
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    The uml does good job showing what is needed. As far as the methods, use the name and return type to figure out how to design them, how familiar are you with java?

  7. #7
    Mully is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default

    Quote Originally Posted by sunde887 View Post
    The uml does good job showing what is needed. As far as the methods, use the name and return type to figure out how to design them, how familiar are you with java?
    Not great.

    I can do the bare minimum. Which is why i'm asking for help :D

  8. #8
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Alright, first start with the basics, build the item class and design the constructor, and all the methods you can, leave the methods you can't design blank. After you do that post up the code.

    Java Code:
    public class Sample{
      private int x;
      protected Sample(int x){
        this.x = x;
       }
    }
    Is an example of a constructor, bit hard to type code on an iPhone so I apologize

  9. #9
    Mully is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default

    Java Code:
    <snip>
    I had this up to the point that I posted.
    Last edited by Mully; 03-03-2011 at 03:53 PM.

  10. #10
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,993
    Rep Power
    9

    Default

    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  11. #11
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    All the methods you left out are getters and setters, use the return type to discover which is a getter and which is a setter, getters return a type, setters return void.

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

    Default

    Looks like a homework dump to me...

    I mean, you've even got the UML diagrams to work from, so you should at the least have a skeleton program!

  13. #13
    Mully is offline Member
    Join Date
    Mar 2011
    Posts
    6
    Rep Power
    0

    Default

    Quote Originally Posted by Tolls View Post
    Looks like a homework dump to me...

    I mean, you've even got the UML diagrams to work from, so you should at the least have a skeleton program!
    And that I did.

Posting Permissions

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