Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var count int
- fmt.Scanln(&count)
- var size, delivery string
- fmt.Scanln(&size)
- fmt.Scanln(&delivery)
- var price = 0
- var discountPercentage = 0.0
- if count <= 10 {
- fmt.Println("Invalid order")
- } else {
- switch size {
- case "90X130":
- price = 110
- if count > 60 {
- discountPercentage = 8
- } else if count > 30 {
- discountPercentage = 5
- }
- case "100X150":
- price = 140
- if count > 80 {
- discountPercentage = 10
- } else if count > 40 {
- discountPercentage = 6
- }
- case "130X180":
- price = 190
- if count > 50 {
- discountPercentage = 12
- } else if count > 20 {
- discountPercentage = 7
- }
- case "200X300":
- price = 250
- if count > 50 {
- discountPercentage = 14
- } else if count > 25 {
- discountPercentage = 9
- }
- }
- var totalPrice = float64(price * count) * (100 - discountPercentage) / 100
- if delivery == "With" {
- totalPrice += 60
- }
- if count > 99 {
- totalPrice *= 0.96
- }
- fmt.Printf("%.2f BGN\n", totalPrice)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement