Exemplo n.º 1
0
        public Transaction(Customer customer, Film film, int days)
        {
            Calculator calc = new Calculator();

            this.customer = customer;
            this.film = film;
            this.days = days;
            this.price = calc.PerformOperation("useMoney", film.FilmType, days);
            int bonusCost = (int)calc.PerformOperation("useBonus", film.FilmType, days);
            this.bonusable = this.customer.bonusPoints >= bonusCost;
            this.bonusPoints = (this.bonusable) ? bonusCost : 0;
        }
Exemplo n.º 2
0
 public void ChargeBonus(Type type)
 {
     Calculator calc = new Calculator();
     this.bonusPoints += (int)calc.PerformOperation("getBonus", type, 0);
 }