Example #1
0
        public double sumPrice()
        {
            CodecDecorator codecDecorator = new TripAdvisorDecorator();
            double         sum            = 0;

            foreach (TripAdvisor tripAdvisor in tripAdvisors)
            {
                sum += int.Parse(codecDecorator.encoding(tripAdvisor.Price));
            }
            foreach (ListNode listNode in listBookings)
            {
                sum += int.Parse(codecDecorator.encoding(listNode.Price));
            }
            return(sum);
        }
Example #2
0
        public double averageRating()
        {
            CodecDecorator codecDecorator = new TripAdvisorDecorator();
            double         sum            = 0;

            foreach (TripAdvisor tripAdvisor in tripAdvisors)
            {
                sum += int.Parse(codecDecorator.encoding(tripAdvisor.Rating));
            }
            foreach (ListNode listNode in listBookings)
            {
                sum += int.Parse(codecDecorator.encoding(listNode.Rating));
            }
            return(sum / (countOfDays * 4));
        }