Advertisement
Spocoman

Film Premiere

Oct 9th, 2024
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 1.24 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "bufio"
  5.     "fmt"
  6.     "os"
  7.     "strconv"
  8. )
  9.  
  10. func main() {
  11.     scanner := bufio.NewScanner(os.Stdin)
  12.     scanner.Scan()
  13.     movie := scanner.Text()
  14.    
  15.     scanner.Scan()
  16.     pack := scanner.Text()
  17.    
  18.     scanner.Scan()
  19.     tickets, _ := strconv.Atoi(scanner.Text())
  20.    
  21.     ticketPrice := 0.0
  22.  
  23.     if movie == "John Wick" {
  24.         if pack == "Drink" {
  25.             ticketPrice = 12
  26.         } else if pack == "Popcorn" {
  27.             ticketPrice = 15
  28.         } else {
  29.             ticketPrice = 19
  30.         }
  31.     } else if movie == "Star Wars" {
  32.         if pack == "Drink" {
  33.             ticketPrice = 18
  34.         } else if pack == "Popcorn" {
  35.             ticketPrice = 25
  36.         } else {
  37.             ticketPrice = 30
  38.         }
  39.     } else if movie == "Jumanji" {
  40.         if pack == "Drink" {
  41.             ticketPrice = 9
  42.         } else if pack == "Popcorn" {
  43.             ticketPrice = 11
  44.         } else {
  45.             ticketPrice = 14
  46.         }
  47.     }
  48.  
  49.     if movie == "Star Wars" && tickets >= 4 {
  50.         ticketPrice *= 0.70
  51.     } else if movie == "Jumanji" && tickets == 2 {
  52.         ticketPrice *= 0.85
  53.     }
  54.  
  55.     fmt.Printf("Your bill is %.2f leva.\n", ticketPrice * float64(tickets))
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement