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()
- movie := scanner.Text()
- scanner.Scan()
- pack := scanner.Text()
- scanner.Scan()
- tickets, _ := strconv.Atoi(scanner.Text())
- ticketPrice := 0.0
- if movie == "John Wick" {
- if pack == "Drink" {
- ticketPrice = 12
- } else if pack == "Popcorn" {
- ticketPrice = 15
- } else {
- ticketPrice = 19
- }
- } else if movie == "Star Wars" {
- if pack == "Drink" {
- ticketPrice = 18
- } else if pack == "Popcorn" {
- ticketPrice = 25
- } else {
- ticketPrice = 30
- }
- } else if movie == "Jumanji" {
- if pack == "Drink" {
- ticketPrice = 9
- } else if pack == "Popcorn" {
- ticketPrice = 11
- } else {
- ticketPrice = 14
- }
- }
- if movie == "Star Wars" && tickets >= 4 {
- ticketPrice *= 0.70
- } else if movie == "Jumanji" && tickets == 2 {
- ticketPrice *= 0.85
- }
- fmt.Printf("Your bill is %.2f leva.\n", ticketPrice * float64(tickets))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement