Advertisement
Spocoman

Agency Profit(90\100)

Sep 28th, 2024
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.58 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var agency string
  7.     fmt.Scanln(&agency)
  8.  
  9.     var tickets, kidTickets int
  10.     fmt.Scanln(&tickets)
  11.     fmt.Scanln(&kidTickets)
  12.  
  13.     var ticketPrice, service float64
  14.     fmt.Scanln(&ticketPrice)
  15.     fmt.Scanln(&service)
  16.      
  17.     totalAdultTicketPrice := (ticketPrice + service) * float64(tickets)
  18.     totalKidTicketPrice := (0.3 * ticketPrice + service) * float64(kidTickets)
  19.     profit := (totalAdultTicketPrice + totalKidTicketPrice) / 5
  20.  
  21.     fmt.Printf("The profit of your agency from %s tickets is %.2f lv.", agency, profit)
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement