Exemplo n.º 1
0
        void CalculatePrice(NormalTicket ticket)
        {
            int   tariefeenheden = Tariefeenheden.getTariefeenheden(ticket.From, ticket.To);
            float p;

            p = 0.16f * tariefeenheden + 0.82f; // is uit appendix B van Lab 2

            if (ticket.Class == 1)
            {
                p = p * 1.7f;
            }

            if (ticket.International)
            {
                p = p + 2f;
            }

            if (!ticket.Single)
            {
                p = p * 2f;
            }
            p *= amount;

            if (tariefeenheden == 0)
            {
                p = 0f;
            }
            price = p;
        }
Exemplo n.º 2
0
        private void handlePayment(NormalTicket ticket)
        {
            CalculatePrice(ticket);

            sale = new Sale(price);
            sale.ShowDialog();
            if (paid)
            {
                printer = new Printer1(amount, ticket, price);
                printer.Print();
            }
            paid = false;
        }
Exemplo n.º 3
0
 public Printer1(int nrTickets, NormalTicket ticket, float price) : base(nrTickets, ticket, price)
 {
     numberofTickets = nrTickets;
     Ticket          = ticket;
     Prijs           = price;
 }