Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var season, group string
- fmt.Scanln(&season)
- fmt.Scanln(&group)
- var people, nights int
- fmt.Scanln(&people)
- fmt.Scanln(&nights)
- var price = 0.0
- var sport = ""
- if (season == "Winter") {
- switch (group) {
- case "boys":
- price = 9.60
- sport = "Judo"
- case "girls":
- price = 9.60
- sport = "Gymnastics"
- case "mixed":
- price = 10.00
- sport = "Ski"
- }
- } else if (season == "Spring") {
- switch (group) {
- case "boys":
- price = 7.20
- sport = "Tennis"
- case "girls":
- price = 7.20
- sport = "Athletics"
- case "mixed":
- price = 9.50
- sport = "Cycling"
- }
- } else {
- switch (group) {
- case "boys":
- price = 15.00
- sport = "Football"
- case "girls":
- price = 15.00
- sport = "Volleyball"
- case "mixed":
- price = 20.00
- sport = "Swimming"
- }
- }
- if (people >= 50) {
- price *= 0.50
- } else if (people >= 20) {
- price *= 0.85
- } else if (people >= 10) {
- price *= 0.95
- }
- var totalSum = price * float64(people) * float64(nights)
- fmt.Printf(" %s %.2f lv.\n", sport, totalSum)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement