Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var guests int
- fmt.Scanln(&guests)
- var envelope, budget float64
- fmt.Scanln(&envelope)
- fmt.Scanln(&budget)
- sum := float64(guests) * envelope
- if guests >= 10 && guests <= 15 {
- sum *= 0.85
- } else if guests > 15 && guests <= 20 {
- sum *= 0.80
- } else if guests > 20 {
- sum *= 0.75
- }
- sum += budget / 10
- if budget >= sum {
- fmt.Printf("It is party time! %.2f leva left.\n", budget - sum)
- } else {
- fmt.Printf("No party! %.2f leva needed.\n", sum - budget)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement