Advertisement
Spocoman

Cat Shirt

Oct 4th, 2024
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.70 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var sleeveSize, frontSize float64
  7.     fmt.Scanln(&sleeveSize)
  8.     fmt.Scanln(&frontSize)
  9.  
  10.     sum := (sleeveSize * 2 + frontSize * 2) * 1.1 / 100
  11.    
  12.     var fabricTypes, tieOrNot string
  13.     fmt.Scanln(&fabricTypes)
  14.     fmt.Scanln(&tieOrNot)
  15.  
  16.     switch (fabricTypes) {
  17.         case "Linen":
  18.             sum *= 15
  19.         case "Cotton":
  20.             sum *= 12
  21.         case "Denim":
  22.             sum *= 20
  23.         case "Twill":
  24.             sum *= 16
  25.         case "Flannel":
  26.             sum *= 11
  27.     }
  28.  
  29.     sum += 10
  30.  
  31.     if tieOrNot == "Yes" {
  32.         sum *= 1.2
  33.     }
  34.  
  35.     fmt.Printf("The price of the shirt is: %.2flv.\n", sum)
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement