Advertisement
Spocoman

Mobile operator

Oct 10th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 1.11 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var year, typee, net string
  7.     fmt.Scanln(&year)
  8.     fmt.Scanln(&typee)
  9.     fmt.Scanln(&net)
  10.    
  11.     var months int
  12.     fmt.Scanln(&months)
  13.    
  14.     price := 0.0
  15.  
  16.     switch typee {
  17.     case "Small":
  18.         if year == "one" {
  19.             price = 9.98
  20.         } else {
  21.             price = 8.58
  22.         }
  23.     case "Middle":
  24.         if year == "one" {
  25.             price = 18.99
  26.         } else {
  27.             price = 17.09
  28.         }
  29.     case "Large":
  30.         if year == "one" {
  31.             price = 25.98
  32.         } else {
  33.             price = 23.59
  34.         }
  35.     case "ExtraLarge":
  36.         if year == "one" {
  37.             price = 35.99
  38.         } else {
  39.             price = 31.79
  40.         }
  41.     }
  42.  
  43.     if net == "yes" {
  44.         if price <= 10 {
  45.             price += 5.50
  46.         } else if price <= 30 {
  47.             price += 4.35
  48.         } else {
  49.             price += 3.85
  50.         }
  51.     }
  52.  
  53.     total := price * float64(months)
  54.  
  55.     if year == "two" {
  56.         total -= 3.75 * total / 100
  57.     }
  58.  
  59.     fmt.Printf("%.2f lv.\n", total)
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement