Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var destination, dates string
- fmt.Scanln(&destination)
- fmt.Scanln(&dates)
- var nights int
- fmt.Scanln(&nights)
- sumPerNight := 0.0
- switch destination {
- case "France": {
- switch dates {
- case "21-23":
- sumPerNight = 30
- case "24-27":
- sumPerNight = 35
- case "28-31":
- sumPerNight = 40
- }
- }
- case "Italy": {
- switch dates {
- case "21-23":
- sumPerNight = 28
- case "24-27":
- sumPerNight = 32
- case "28-31":
- sumPerNight = 39
- }
- }
- case "Germany": {
- switch dates {
- case "21-23":
- sumPerNight = 32
- case "24-27":
- sumPerNight = 37
- case "28-31":
- sumPerNight = 43
- }
- }
- }
- fmt.Printf("Easter trip to %s : %.2f leva.\n", destination, sumPerNight * float64(nights))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement