Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 falseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started