fun main(args : Array<String>){
ifElseOnVariabel()
}
fun ifElseGayaKu(){
val openHours = 7
val now = 20
if(now > openHours){
println("Office already open")
}
else{
println("Office is closed")
}
}
fun ifElseGayaDicoding(){
val openHours = 7
val now = 20
val office : String
if(now > openHours){
office = "Office already open"
}
else{
office = "Office is closed"
}
print(office)
}
fun ifElseOnVariabel(){
val openHours = 7
val now = 20
val office : String
office = if (now > openHours){
"Office already open"
}
else{
"Office is closed"
}
println(office)
}