Question
Asked by:
howithink
howithink
Rating : No Rating
Questions Asked: 2
Tutorials Posted: 0
 

$3.00 Java Help with Copy Constructor and Equals Method.

Q:
This relates to the SimpleSet code that we discussed in class. Please add: 1) a copy constructor and 2) and equals method. The signatures would be:

public SimpleSet(SimpleSet sourceSet) { ... }

public boolean equals(SimpleSet otherSet) { ... }

The copy constructor should create an exact duplicate of the sourceSet argument. The equals() method should return true only if all of the real elements (not the -1 placeholders) appears in both sets - the order of the values doesn't matter.

Please provide a sample test in the SimpleSetTest.java file provided in the attachment. Also the above code needs to go at the end of SimpleSet.java file provided in the attachment.

thank you
 
Attachments:
SimpleSet(2).zip (2K)


   
   
   
   
 
Available Tutorials to this Question
Posted by:
max_max
max_max
Rating (31): B+
Questions Asked: 0
Tutorials Posted: 194, earned $232.71
 

$5.00 Added the copy constructor and equal method

  • This tutorial hasn't been purchased yet.
  • Posted on May 31, 2009 at 3:13:01PM
A:
Preview: ... ttache ...

The full tutorial is about 5 words long plus attachments.

Attachments:
SimpleSet.java (7K) (Preview)
SimpleSetTest.java (0K) (Preview)
Posted by:
 

$6.00 Complete solution for Copy Constructor and Equals Method.

  • This tutorial was purchased 1 time and rated A+ by students like you.
  • Posted on May 31, 2009 at 4:02:10PM
A:
Preview: ... i i have attached the solution ...

The full tutorial is about 30 words long plus attachments.

Attachments:
SimpleSet_Solution.zip (5K)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty