So, let's start with an event with the user input. Go through the following example:
fun main(args: Array<String>) { println("Initial Out put with a = 15, b = 10") var calculator:ReactiveCalculator = ReactiveCalculator(15,10) println("Enter a = <number> or b = <number> in separate lines\nexit to exit the program") var line:String? do { line = readLine(); calculator.handleInput(line) } while (line!= null && !line.toLowerCase().contains("exit")) }
If you run the code, you'll get the following output:
In the main method, we are not doing much operation except for just listening to the input and passing it to the ...