Advertisement
Spocoman

Safari

Oct 12th, 2024
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.49 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var budget, fuel float64
  7.     fmt.Scanln(&budget)
  8.     fmt.Scanln(&fuel)
  9.  
  10.     sum := 2.10 * fuel + 100
  11.    
  12.     var day string
  13.     fmt.Scanln(&day)
  14.  
  15.     if day == "Saturday" {
  16.         sum *= 0.90
  17.     } else {
  18.         sum *= 0.80
  19.     }
  20.  
  21.     if budget >= sum {
  22.         fmt.Printf("Safari time! Money left: %.2f lv.\n", budget - sum)
  23.     } else {
  24.         fmt.Printf("Not enough money! Money needed: %.2f lv.\n", sum - budget)
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement