...

/

Taking the App for a Drive

Taking the App for a Drive

We'll cover the following...

Writing main() function

Let’s write a main() function to call the getAirportStatus() function with a few different airport codes and print the status of the airports with those codes to the console. In your local setup create a file named AirportApp.kt in the directory src/main/kotlin/com/agiledeveloper/ui and key in the following code:

Press + to interact
package com.agiledeveloper.ui
import kotlinx.coroutines.*
import com.agiledeveloper.airportstatus.*
fun main() = runBlocking {
getAirportStatus(listOf("SFO", "IAD", "IAH", "ORD", "LAX"))
.forEach { println(it) }
}

Since ...