Advertisement
Spocoman

Painting Eggs

Oct 12th, 2024 (edited)
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.84 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var size, color string
  7.     fmt.Scanln(&size)
  8.     fmt.Scanln(&color)
  9.    
  10.     var volume int
  11.     fmt.Scanln(&volume)
  12.  
  13.     sum := 0
  14.  
  15.     switch size {
  16.     case "Large":
  17.         switch color {
  18.         case "Red":
  19.             sum = 16
  20.         case "Green":
  21.             sum = 12
  22.         case "Yellow":
  23.             sum = 9
  24.         }
  25.     case "Medium":
  26.         switch color {
  27.         case "Red":
  28.             sum = 13
  29.         case "Green":
  30.             sum = 9
  31.         case "Yellow":
  32.             sum = 7
  33.         }
  34.     case "Small":
  35.         switch color {
  36.         case "Red":
  37.             sum = 9
  38.         case "Green":
  39.             sum = 8
  40.         case "Yellow":
  41.             sum = 5
  42.         }
  43.     }
  44.    
  45.     total := float64(sum * volume) * 0.65
  46.     fmt.Printf("%.2f leva.\n", total)
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement