Advertisement
Spocoman

Movie Destination

Oct 11th, 2024
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 1.00 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.   "fmt"
  5.   "math"
  6. )
  7.  
  8. func main() {
  9.     var budget, daySum float64
  10.     fmt.Scanln(&budget)
  11.    
  12.     var destination, season string
  13.     fmt.Scanln(&destination)
  14.     fmt.Scanln(&season)
  15.    
  16.     var days int
  17.     fmt.Scanln(&days)
  18.  
  19.     if destination == "Dubai" {
  20.         if season == "Winter" {
  21.             daySum = 45000
  22.         } else {
  23.             daySum = 40000
  24.         }
  25.         daySum *= 0.70
  26.     } else if destination == "Sofia" {
  27.         if season == "Winter" {
  28.             daySum = 17000
  29.         } else {
  30.             daySum = 12500
  31.         }
  32.         daySum *= 1.25
  33.     } else {
  34.         if season == "Winter" {
  35.             daySum = 24000
  36.         } else {
  37.             daySum = 20250
  38.         }
  39.     }
  40.  
  41.     budget -= daySum * float64(days)
  42.  
  43.     if budget >= 0 {
  44.         fmt.Printf("The budget for the movie is enough! We have %.2f leva left!\n", budget)
  45.     } else {
  46.         fmt.Printf("The director needs %.2f leva more!\n", math.Abs(budget))
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement