Advertisement
Spocoman

Easter Trip

Oct 8th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.99 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var destination, dates string
  7.     fmt.Scanln(&destination)
  8.     fmt.Scanln(&dates)
  9.    
  10.     var nights int
  11.     fmt.Scanln(&nights)
  12.  
  13.     sumPerNight := 0.0
  14.  
  15.     switch destination {
  16.     case "France": {
  17.         switch dates {
  18.         case "21-23":
  19.             sumPerNight = 30
  20.         case "24-27":
  21.             sumPerNight = 35
  22.         case "28-31":
  23.             sumPerNight = 40
  24.         }
  25.     }
  26.     case "Italy": {
  27.         switch dates {
  28.         case "21-23":
  29.             sumPerNight = 28
  30.         case "24-27":
  31.             sumPerNight = 32
  32.         case "28-31":
  33.             sumPerNight = 39
  34.         }
  35.     }
  36.     case "Germany": {
  37.         switch dates {
  38.         case "21-23":
  39.             sumPerNight = 32
  40.         case "24-27":
  41.             sumPerNight = 37
  42.         case "28-31":
  43.             sumPerNight = 43
  44.         }
  45.     }
  46.     }
  47.  
  48.     fmt.Printf("Easter trip to %s : %.2f leva.\n", destination, sumPerNight * float64(nights))
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement