Question: Write a method called containsPair which takes three integers as parameters and returns true if any two of them are the same. If all three

Write a method called "containsPair" which takes three integers as parameters and returns true if any two of them are the same. If all three numbers are different, the method should return false.
The table below shows sample calls and the value that should be returned.
Method Call
Value Returned
containsPair (1,2,3)
false
containsPair (1,1,1)
true
containPair (1,2,1)
true
containsPair (4,5,6)
false
containsPair (5,1,1)
true
Write a method called "containsPair" which takes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!