Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var month string
- fmt.Scanln(&month)
- var nights int
- fmt.Scanln(&nights)
- var apartmentPrice = 0.0
- var studioPrice = 0.0
- if (month == "May" || month == "October") {
- apartmentPrice = 65
- studioPrice = 50
- if (nights > 7 && nights <= 14) {
- studioPrice *= 0.95
- } else if (nights > 14) {
- studioPrice *= 0.70
- }
- } else if (month == "June" || month == "September") {
- apartmentPrice = 68.70
- studioPrice = 75.20
- if (nights > 14) {
- studioPrice *= 0.80
- }
- } else if (month == "July" || month == "August") {
- apartmentPrice = 77
- studioPrice = 76
- }
- if (nights > 14) {
- apartmentPrice *= 0.9
- }
- fmt.Printf("Apartment: %.2f lv.\nStudio: %.2f lv.\n", apartmentPrice * float64(nights), studioPrice * float64(nights))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement