Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var flower string
- fmt.Scanln(&flower)
- var quantity int
- fmt.Scanln(&quantity)
- var budget float64
- fmt.Scanln(&budget)
- var sum = float64(quantity)
- if (flower == "Roses") {
- sum *= 5.00
- if (quantity > 80) {
- sum *= 0.90
- }
- } else if (flower == "Dahlias") {
- sum *= 3.80
- if (quantity > 90) {
- sum *= 0.85
- }
- } else if (flower == "Tulips") {
- sum *= 2.80
- if (quantity > 80) {
- sum *= 0.85
- }
- } else if (flower == "Narcissus") {
- sum *= 3.00
- if (quantity < 120) {
- sum *= 1.15
- }
- } else if (flower == "Gladiolus") {
- sum *= 2.50
- if (quantity < 80) {
- sum *= 1.20
- }
- }
- if (sum > budget) {
- fmt.Printf("Not enough money, you need %.2f leva more.", sum - budget)
- } else {
- fmt.Printf("Hey, you have a great garden with %d %s and %.2f leva left.", quantity, flower, budget - sum)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement