Category programming

Control Flow Statements in Kotlin

The statements in your program generally executed from top to bottom. Control flow statements allows the execution to be broken/interrupted by applying decision making, iteration, branching or conditionally execute a partial part of the program. This article discuss the decision-making…

Getting User Input into a Kotlin Program

To read a user input from a Kotlin program, use the readLine() function. The readLine() function allows the program’s user to enter a string values or intercept keyboard input from the console. When you run the program, the output will…

Kotlin: Data Type Conversions

From time to time, you might need to convert (i.e. casting) a variable from one data type to another. Example such as converting a string to a number. Kotlin contains predefined functions that allows you to do the data type…

Kotlin Data Types

The basic data types used in Kotlin are strings, characters, booleans, numbers and arrays. String Use double-quotes to define a string. Used to store words or sentences. Character Use single-quote to define a character. Used to store a single character.…

Kotlin Variables: Mutable vs Immutable

In Kotlin, there are two types of variables; mutable variable and immutable variable. Mutable Variables Mutable variable is a variable whose value can be changed or updated from time to time. To declare a mutable variable, we use the var…

An OOP Story

Every time I am teaching the OOP concepts, I always tell this story to my audiences. Since my first class back in 2008 until today. Without fail. The story is applicable to any programming languages. This is a story about…

Association Rules in R

Disclaimer: This example is taken from a reference titled ‘R In A Nutshell’ by Joseph A. Adler One of my favourite examples from the book is this one. Mostly because it talks about my favourite bands. Association rules are a…