// Whilesum.kt Copyright (c) Kari Laitinen // http://www.naturalprogramming.com // 2020-10-27 File created. fun main() { var integer_from_keyboard = -1 var sum_of_integers = 0 print( "\n This program calculates the sum of the integers" + "\n you type in from the keyboard. By entering a" + "\n zero you can terminate the program. \n\n" ) while ( integer_from_keyboard != 0 ) { print( String.format( " Current sum: %8d Enter an integer: ", sum_of_integers ) ) integer_from_keyboard = readLine()!!.toInt() sum_of_integers = sum_of_integers + integer_from_keyboard } print( "\n" ) }