This is an old revision of the document!
Lab 1 - Kotlin
Objectives
Introduction to Kotlin
Data types
Control Flow
Functions
Extension
Tasks
All tasks will be solved in the Kotlin Playground.
When a task is done, please share it to the teacher using the Share button located on the left.
Write a Kotlin application that displays your name.
Write a Kotlin function that computes the factorial for n in an iterative way (without recursion).
Modify the previous function in such a way that is is written as a single expression.
Write an Int extension function that computes (as Double) the logarithm of its parameter in base `this`. Use it in two ways:
`2.log(8.0)
`2 log 8.0`
Modify the previous task to be able to use the function with Int numbers as well (`2 log 8`)