Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var dayCash, dayProfit, cost, giftPrice float64
- fmt.Scanln(&dayCash)
- fmt.Scanln(&dayProfit)
- fmt.Scanln(&cost)
- fmt.Scanln(&giftPrice)
- total := (dayCash + dayProfit) * 5 - cost
- if total >= giftPrice {
- fmt.Printf("Profit: %.2f BGN, the gift has been purchased.", total)
- } else {
- fmt.Printf("Insufficient money: %.2f BGN.", giftPrice - total)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement