Advertisement
Spocoman

05. Journey

Sep 18th, 2024 (edited)
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.98 KB | None | 0 0
  1. package main
  2. import "fmt"
  3.  
  4. func main() {
  5.     var budget float64
  6.     fmt.Scanln(&budget)
  7.    
  8.     var season string
  9.     fmt.Scanln(&season)
  10.    
  11.     var place = ""
  12.     var region = ""
  13.  
  14.     switch (season) {
  15.         case "summer":
  16.             place = "Camp";
  17.             if (budget <= 100) {
  18.                 budget *= 0.3
  19.             } else if (budget > 100 && budget <= 1000) {
  20.                 budget *= 0.4
  21.             }
  22.         case "winter":
  23.             place = "Hotel"
  24.             if (budget <= 100) {
  25.                 budget *= 0.7
  26.             } else if (budget > 100 && budget <= 1000) {
  27.                 budget *= 0.8
  28.             }
  29.     }
  30.        
  31.     if (budget <= 100) {
  32.         region = "Bulgaria"
  33.     } else if (budget > 100 && budget <= 1000) {
  34.             region = "Balkans"
  35.     } else {
  36.             place = "Hotel"
  37.             region = "Europe"
  38.             budget *= 0.9
  39.     }
  40.  
  41.     fmt.Printf("Somewhere in %s\n%s - %.2f\n", region, place, budget)
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement