Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "bufio"
- "fmt"
- "os"
- "strconv"
- )
- func main() {
- scanner := bufio.NewScanner(os.Stdin)
- scanner.Scan()
- stageOfTheChampionship := scanner.Text()
- scanner.Scan()
- typeOfTickets := scanner.Text()
- scanner.Scan()
- ticketCount,_ := strconv.Atoi(scanner.Text())
- scanner.Scan()
- selfieWithTheTrophy := scanner.Text()
- var ticketPrice, totalPrice float64
- if stageOfTheChampionship == "Quarter final" {
- if typeOfTickets == "Standard" {
- ticketPrice = 55.50
- } else if typeOfTickets == "Premium" {
- ticketPrice = 105.20
- } else if typeOfTickets == "VIP" {
- ticketPrice = 118.90
- }
- } else if stageOfTheChampionship == "Semi final" {
- if typeOfTickets == "Standard" {
- ticketPrice = 75.88
- } else if typeOfTickets == "Premium" {
- ticketPrice = 125.22
- } else if typeOfTickets == "VIP" {
- ticketPrice = 300.40
- }
- } else if stageOfTheChampionship == "Final" {
- if typeOfTickets == "Standard" {
- ticketPrice = 110.10
- } else if typeOfTickets == "Premium" {
- ticketPrice = 160.66
- } else if typeOfTickets == "VIP" {
- ticketPrice = 400.00
- }
- }
- totalPrice = ticketPrice * float64(ticketCount)
- if totalPrice > 4000 {
- totalPrice *= 0.75
- selfieWithTheTrophy = "N"
- } else if totalPrice > 2500 {
- totalPrice *= 0.90
- }
- if selfieWithTheTrophy == "Y" {
- totalPrice += float64(ticketCount * 40)
- }
- fmt.Printf("%.2f\n", totalPrice)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement