Advertisement
Spocoman

Bracelet Stand

Oct 3rd, 2024
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.45 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var dayCash, dayProfit, cost, giftPrice float64
  7.     fmt.Scanln(&dayCash)
  8.     fmt.Scanln(&dayProfit)
  9.     fmt.Scanln(&cost)
  10.     fmt.Scanln(&giftPrice)
  11.  
  12.     total := (dayCash + dayProfit) * 5 - cost
  13.  
  14.     if total >= giftPrice {
  15.         fmt.Printf("Profit: %.2f BGN, the gift has been purchased.", total)
  16.     } else {
  17.         fmt.Printf("Insufficient money: %.2f BGN.", giftPrice - total)
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement