Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var priceBagOver20kg, bagWeight float64
- fmt.Scanln(&priceBagOver20kg)
- fmt.Scanln(&bagWeight)
- var days, bags int
- fmt.Scanln(&days)
- fmt.Scanln(&bags)
- if bagWeight < 10 {
- priceBagOver20kg /= 5
- } else if bagWeight <= 20 {
- priceBagOver20kg /= 2
- }
- if days < 7 {
- priceBagOver20kg *= 1.40
- } else if days <= 30 {
- priceBagOver20kg *= 1.15
- } else {
- priceBagOver20kg *= 1.10
- }
- totalPrice := priceBagOver20kg * float64(bags)
- fmt.Printf("The total price of bags is: %.2f lv.\n", totalPrice)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement