Question: Keep getting Boolean does not equal True as an error. Please help. // EXERCISE 4 complete the following function // It has two parameters /1
Keep getting Boolean does not equal True as an error. Please help.
// EXERCISE 4 complete the following function // It has two parameters /1 - r: (a reference to) an instance of RefInt (see above for the definition of the class RefInt); AND // - f: a function that accepts (a reference to) an instance of RefInt. // Your code must call f with a *copy" of the Refint r, .. , it must make a new instance of Refint with the same Int // Your code should return true if f has NOT changed the Int stored in the copy of r. otherwise it should return false def refint4 (r RefInt, f RefInt -unit) Boolean- uitkenew instance of ref nt wioh che esure faise. // TODO: Provide definition here. var z new RefInt (r.get) f (z) if (z.getr.get) true false // EXERCISE 4 complete the following function // It has two parameters /1 - r: (a reference to) an instance of RefInt (see above for the definition of the class RefInt); AND // - f: a function that accepts (a reference to) an instance of RefInt. // Your code must call f with a *copy" of the Refint r, .. , it must make a new instance of Refint with the same Int // Your code should return true if f has NOT changed the Int stored in the copy of r. otherwise it should return false def refint4 (r RefInt, f RefInt -unit) Boolean- uitkenew instance of ref nt wioh che esure faise. // TODO: Provide definition here. var z new RefInt (r.get) f (z) if (z.getr.get) true false
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
