Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var budget float64
- fmt.Scanln(&budget)
- var category string
- fmt.Scanln(&category)
- var people int
- fmt.Scanln(&people)
- var sum = 0.0
- if (people >= 1 && people <= 4) {
- budget *= 0.25
- } else if (people > 4 && people <= 9) {
- budget *= 0.40
- } else if (people > 9 && people <= 24) {
- budget *= 0.50
- } else if (people > 24 && people < 50) {
- budget *= 0.60
- } else {
- budget *= 0.75
- }
- if (category == "VIP") {
- sum = 499.99 * float64(people)
- } else if (category == "Normal") {
- sum = 249.99 * float64(people)
- }
- if (budget >= sum) {
- fmt.Printf("Yes! You have %.2f leva left.", budget - sum)
- } else {
- fmt.Printf("Not enough money! You need %.2f leva.", sum - budget)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement