Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var year, typee, net string
- fmt.Scanln(&year)
- fmt.Scanln(&typee)
- fmt.Scanln(&net)
- var months int
- fmt.Scanln(&months)
- price := 0.0
- switch typee {
- case "Small":
- if year == "one" {
- price = 9.98
- } else {
- price = 8.58
- }
- case "Middle":
- if year == "one" {
- price = 18.99
- } else {
- price = 17.09
- }
- case "Large":
- if year == "one" {
- price = 25.98
- } else {
- price = 23.59
- }
- case "ExtraLarge":
- if year == "one" {
- price = 35.99
- } else {
- price = 31.79
- }
- }
- if net == "yes" {
- if price <= 10 {
- price += 5.50
- } else if price <= 30 {
- price += 4.35
- } else {
- price += 3.85
- }
- }
- total := price * float64(months)
- if year == "two" {
- total -= 3.75 * total / 100
- }
- fmt.Printf("%.2f lv.\n", total)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement