//This Fish class demonstrates taking another Fish as an argument, as well as writing //multiple methods to solve a problem class Fish { int weight; Fish( int weight ) { this.weight = weight; } //new Fish(5).weightDifference( new Fish(6) ) == -1 //new Fish(5).weightDifference( new Fish(2) ) == 3 //What is the difference between this Fish's weight and your Fish //Note: With this problem, we try to find how much bigger this Fish is than your Fish int weightDifference( Fish yourFish ) { //... this.weight ... yourFish ... return yourFish.howMuchSmaller( this.weight ); //When we reached the body step, we realized that there were no methods on Fish that //took a number and returned the amount that the Fish's weight was smaller than the given //number. We therefore wished we had such a method, and so put it on a Wishlist //To put a number on a wishlist requires doing the purpose and header for that method, and //then coming back to it after finishing the body of the method that uses the wished for method } //Wished For method //To get the difference between this Fish's weight and a givenWeight int howMuchSmaller( int givenWeight ) { // ... this.weight ... givenWeight ... return givenWeight - this.weight; } //Examples (examples may be above or below a method, depending on your preference) //new Fish(3).howMuchSmaller( 5 ) == 2 //new Fish(5).howMuchSmaller( 1 ) == -4 }