Please help me to finish my online learning academy. The question is as follows:
Complete the code in the Cat class with the following provisions:
-Create a getter setter function for the Sleep property in which there is a function for printing text:
The getter/setter function is invoked
-Add the code in the toSleep() function to print the text:
If sleep is true and the text is:
Name, let’s play!
If sleep is false.
You can see the Kotlin code that I’ve created to fix it in the screenshot which i attached. Thank. Hope your day is fun!