Advertisement
Spocoman

07. Working Hours

Sep 18th, 2024
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.44 KB | None | 0 0
  1. package main
  2. import "fmt"
  3.  
  4. func main() {
  5.     var hour int
  6.     fmt.Scanln(&hour)
  7.    
  8.     var day string
  9.     fmt.Scanln(&day)
  10.    
  11.     if (hour >= 10 && hour <= 18) {
  12.         switch (day) {
  13.             case "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday":
  14.                 fmt.Println("open")
  15.             default:
  16.                 fmt.Println("closed")
  17.         }
  18.     } else {
  19.         fmt.Println("closed")
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement