Advertisement
Spocoman

05. Vacation

Sep 19th, 2024
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.79 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 location = ""
  12.     var place = ""
  13.  
  14.     if (season == "Summer") {
  15.         location = "Alaska"
  16.     } else {
  17.         location = "Morocco"
  18.     }
  19.  
  20.     if (budget > 3000) {
  21.         place = "Hotel"
  22.         budget *= 0.90
  23.     } else if (budget > 1000) {
  24.         if (season == "Summer") {
  25.             budget *= 0.80
  26.         } else {
  27.             budget *= 0.60
  28.         }
  29.         place = "Hut"
  30.     } else if (budget > 0) {
  31.         if (season == "Summer") {
  32.             budget *= 0.65
  33.         } else {
  34.             budget *= 0.45
  35.         }
  36.         place = "Camp"
  37.     }
  38.    
  39.     fmt.Printf("%s - %s - %.2f\n", location, place, budget)
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement