KT
kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Updated for Adam Fakhrul Rozi
// https://www.sololearn.com/Profile/11254843
// https://www.sololearn.com/Discuss/2230601
// How to Fix The setter & getter ?
// Please help me to finish my online learning academy. The question is as follows:
// TODO 1:
// 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:
// [$name], sleep!
// If sleep is true and the text is:
// Name, let's play!
// If sleep is false.
// --------------------------------------------------------------------------------------------------------
// You can change the Kotlin code that I've created to fix it in this link :
// https://code.sololearn.com/cOvmXL5KrVG8
// Thanks. Hope your day is fun!
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run