fun main(args : Array<String>){
negation()
}
fun myStyle(){
val officeOpen = 7
val officeClosed = 16
val now = 20
val isOpen : Boolean
if(now >= officeOpen && now <= officeClosed){
isOpen = true
print("Office is open : $isOpen")
}
else{
isOpen = false
print("Office is open : $isOpen")
}
}
fun dicodingStyle(){
val officeOpen = 7
val officeClosed = 16
val now = 20
val isOpen = now >= officeOpen && now <= officeClosed
println("Office is open : $isOpen")
}
fun disjunctionOfficeClose(){
val officeClosed = 16
val officeOpen = 7
val now = 20
val isOpen = now < officeOpen || now > officeClosed
print("Office is closed : $isOpen")
}
fun negation(){
val officeOpen = 7
val now = 10
val isOpen = now > officeOpen
if(!isOpen){
print("Office is closed")
}
else{
print("Office is open")
}
}