Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var budget float64
- fmt.Scanln(&budget)
- var season string
- fmt.Scanln(&season)
- var location = ""
- var place = ""
- if (season == "Summer") {
- location = "Alaska"
- } else {
- location = "Morocco"
- }
- if (budget > 3000) {
- place = "Hotel"
- budget *= 0.90
- } else if (budget > 1000) {
- if (season == "Summer") {
- budget *= 0.80
- } else {
- budget *= 0.60
- }
- place = "Hut"
- } else if (budget > 0) {
- if (season == "Summer") {
- budget *= 0.65
- } else {
- budget *= 0.45
- }
- place = "Camp"
- }
- fmt.Printf("%s - %s - %.2f\n", location, place, budget)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement