Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var typee string
- fmt.Scanln(&typee)
- var quantity, date int
- fmt.Scanln(&quantity)
- fmt.Scanln(&date)
- price := 0.0
- if date <= 15 {
- if typee == "Cake" {
- price = 24.00
- } else if typee == "Souffle" {
- price = 6.66
- } else {
- price = 12.60
- }
- } else {
- if typee == "Cake" {
- price = 28.70
- } else if typee == "Souffle" {
- price = 9.80
- } else {
- price = 16.98
- }
- }
- sum := price * float64(quantity)
- if date <= 22 {
- if sum >= 100 && sum <= 200 {
- sum -= sum * 0.15
- } else if sum > 200 {
- sum -= sum * 0.25
- }
- }
- if date <= 15 {
- sum -= sum * 0.10
- }
- fmt.Printf("%.2f\n", sum)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement