Created
December 24, 2019 20:42
-
-
Save Fallenstedt/05239094f8f0ed8b278bb3bdc06064c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.* | |
fun main(args: Array<String>) { | |
dayOfWeek() | |
} | |
fun dayOfWeek() { | |
println("What day is it today?") | |
val dayOfWeek: Int = Calendar.getInstance().get(Calendar.DAY_OF_WEEK) | |
val dayLiteral: String = when (dayOfWeek) { | |
1 -> "Sunday" | |
2 -> "Monday" | |
3 -> "Tuesday" | |
4 -> "Wednesday" | |
5 -> "Thursday" | |
6 -> "Friday" | |
7 -> "Saturday" | |
else -> "Time has stopped" | |
} | |
println("Today is " + dayLiteral) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment