Can any one solve this Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Max21183
    New Member
    • Mar 2008
    • 1

    Can any one solve this Problem

    Can any one Solve this Probelm? Having some problems Thanks

    1) Create a class with three or more private instance variables. Please create a class for something other than dates.

    (2) Create in this class set (mutator) methods for each instance variable that perform checks for valid input.

    (3) Create in this class get (accessor) methods for each instance variable.

    (4) Create 3 or more constructors for this class. The constructors should utilize the set methods to perform checks for valid input.

    (5) Create a toString() method to display the values of the instance variables in a suitable form.

    (6) Create another class which utilizes the class you created in steps 1-5. This class should

    -instantiate 2 objects, one of which should utilize some default values

    -display the values of the instance variables of these objects using the toString() method

    -use the mutator methods to reset the values of one of the objects and then display the new values using the toString() method
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Great! Let's go for it; what did you do already?

    kind regards,

    Jos

    Comment

    • sukatoa
      Contributor
      • Nov 2007
      • 539

      #3
      Originally posted by Max21183
      Can any one Solve this Probelm? Having some problems Thanks

      1) Create a class with three or more private instance variables. Please create a class for something other than dates.

      (2) Create in this class set (mutator) methods for each instance variable that perform checks for valid input.

      (3) Create in this class get (accessor) methods for each instance variable.

      (4) Create 3 or more constructors for this class. The constructors should utilize the set methods to perform checks for valid input.

      (5) Create a toString() method to display the values of the instance variables in a suitable form.

      (6) Create another class which utilizes the class you created in steps 1-5. This class should

      -instantiate 2 objects, one of which should utilize some default values

      -display the values of the instance variables of these objects using the toString() method

      -use the mutator methods to reset the values of one of the objects and then display the new values using the toString() method
      You can surf it on the web...

      Posting a complete code for you is restricted on this Site...

      Our experts here are happy to help/assists you than to post the whole codes...

      Just ask a specific question with your best effort..."Show what you have done"

      Maybe this was your assignment i guess, ;-)

      Sukatoa

      Comment

      Working...