Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var season string
- fmt.Scanln(&season)
- var km float64
- fmt.Scanln(&km)
- var kmPrice = 0.0
- if (km > 0 && km <= 5000) {
- switch (season) {
- case "Spring", "Autumn":
- kmPrice = 0.75
- case "Summer":
- kmPrice = 0.90
- case "Winter":
- kmPrice = 1.05
- }
- } else if (km > 5000 && km <= 10000) {
- switch (season) {
- case "Spring", "Autumn":
- kmPrice = 0.95
- case "Summer":
- kmPrice = 1.10
- case "Winter":
- kmPrice = 1.25
- }
- } else if (km > 10000 && km <= 20000) {
- kmPrice = 1.45
- }
- fmt.Printf("%.2f\n", kmPrice * km * 4 * 0.90)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement