Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var size, color string
- fmt.Scanln(&size)
- fmt.Scanln(&color)
- var volume int
- fmt.Scanln(&volume)
- sum := 0
- switch size {
- case "Large":
- switch color {
- case "Red":
- sum = 16
- case "Green":
- sum = 12
- case "Yellow":
- sum = 9
- }
- case "Medium":
- switch color {
- case "Red":
- sum = 13
- case "Green":
- sum = 9
- case "Yellow":
- sum = 7
- }
- case "Small":
- switch color {
- case "Red":
- sum = 9
- case "Green":
- sum = 8
- case "Yellow":
- sum = 5
- }
- }
- total := float64(sum * volume) * 0.65
- fmt.Printf("%.2f leva.\n", total)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement