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); }
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)); }