Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var budget, daySum float64
- fmt.Scanln(&budget)
- var destination, season string
- fmt.Scanln(&destination)
- fmt.Scanln(&season)
- var days int
- fmt.Scanln(&days)
- if destination == "Dubai" {
- if season == "Winter" {
- daySum = 45000
- } else {
- daySum = 40000
- }
- daySum *= 0.70
- } else if destination == "Sofia" {
- if season == "Winter" {
- daySum = 17000
- } else {
- daySum = 12500
- }
- daySum *= 1.25
- } else {
- if season == "Winter" {
- daySum = 24000
- } else {
- daySum = 20250
- }
- }
- budget -= daySum * float64(days)
- if budget >= 0 {
- fmt.Printf("The budget for the movie is enough! We have %.2f leva left!\n", budget)
- } else {
- fmt.Printf("The director needs %.2f leva more!\n", math.Abs(budget))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement