Day 2 of Android Development

Hello everyone,



This is day 2 of Android development with Kotlin language , today i just revised previous concept and practice some of the project.

Today is 15th july and i covered 100% of Introduction to Kotlin

In this pathway i learnt

  • Basic maths operator
  • Default parameters
Now i just completed Introduction to Kotlin and at the end of thid pathway google provided a new for kotlin which is present of the HYPERSKILLS named Kotlin to core


PROJECT - 1

Comparision of mobile usage 


fun main() {
    println
("Have I spent more time using my phone today: ${compareTime(300, 250)}")
    println
("Have I spent more time using my phone today: ${compareTime(300, 300)}")
    println
("Have I spent more time using my phone today: ${compareTime(200, 220)}")
}

fun compareTime
(timeSpentToday: Int, timeSpentYesterday: Int): Boolean {
   
return timeSpentToday >
timeSpentYesterday
}

PROJECT - 2

Weather Details of the Cities


fun main () {
    weatherOfCity("Nawada", 23, 39, 68)
    weatherOfCity("Delhi", 24, 43, 56)
    weatherOfCity("Kota", 29, 47, 23)
    weatherOfCity("Tokyo", 32, 36, 10)
    weatherOfCity("Cape Town", 59, 64, 2)
}

fun weatherOfCity(cityName : String, lowTemp : Int, highTemp : Int, chanceOfRain : Int){
    println("City : $cityName")
    println("Low Temperture : $lowTemp , High Temperture : $highTemp")
    println("Chance of Rain: $chanceOfRain%")
    println()
}

Comments