Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var personCount int
- fmt.Scanln(&personCount)
- var season string
- fmt.Scanln(&season)
- personPrice := 0.0
- switch season {
- case "spring":
- if personCount <= 5 {
- personPrice = 50.00
- } else {
- personPrice = 48.00
- }
- case "summer":
- if personCount <= 5 {
- personPrice = 48.50
- } else {
- personPrice = 45.00
- }
- case "autumn":
- if personCount <= 5 {
- personPrice = 60.00
- } else {
- personPrice = 49.50
- }
- case "winter":
- if personCount <= 5 {
- personPrice = 86.00
- } else {
- personPrice = 85.00
- }
- }
- if season == "summer" {
- personPrice *= 0.85
- } else if season == "winter" {
- personPrice *= 1.08
- }
- fmt.Printf("%.2f leva.", personPrice * float64(personCount))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement